From f69e4f9cb95b47b4c7db9f93eb1a5c6e2652186e Mon Sep 17 00:00:00 2001 From: Patrick J Cherry Date: Fri, 31 Oct 2014 12:27:23 +0000 Subject: Don't lock the process before help can be shown. Keep args the same as they used to be. --- byteback-backup | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) (limited to 'byteback-backup') diff --git a/byteback-backup b/byteback-backup index 3bbd749..25de560 100755 --- a/byteback-backup +++ b/byteback-backup @@ -15,24 +15,23 @@ require 'byteback/log' include Byteback::Util include Byteback::Log -lock_out_other_processes("byteback-backup") ME = $0.split("/").last opts = Trollop::options do - banner "#{ME}: Back up this system to a byteback-enabled server" + banner "#{ME}: Back up this system to a byteback-enabled server\n " opt :destination, "Backup destination (i.e. user@host:/path)", :type => :string opt :source, "Source paths", - :type => :strings - - opt :excludes, "Paths to exclude", - :type => :strings + :type => :strings, + :default => ["/"] - banner "\nAdditional excludes can be specified using /etc/byteback/rsync_filter, which is an rsync filter file. See the rsync man page for information on how this works.\n" + opt :exclude, "Paths to exclude", + :type => :strings, + :short => "x" opt :verbose, "Show debugging messages" @@ -46,15 +45,22 @@ opts = Trollop::options do opt :ssh_key, "SSH key filename", :type => :string, - :default => "/etc/byteback/key" + :default => "/etc/byteback/key", + :short => "k" + opt :help, "Show this message", + :short => "h" + + banner "\nAdditional excludes can be specified using /etc/byteback/rsync_filter, which is an rsync filter file. See the rsync man page for information on how this works.\n" end +lock_out_other_processes("byteback-backup") + @ssh_key = opts[:ssh_key] @verbose = opts[:verbose] ? "--verbose" : nil @sources = opts[:source] if opts[:source] -@excludes = opts[:excludes] if opts[:excludes] +@excludes = opts[:exclude] if opts[:exclude] @destination = opts[:destination] @retry_number = opts[:retry_number] @retry_delay = opts[:retry_delay] -- cgit v1.2.3