summaryrefslogtreecommitdiff
path: root/byteback-backup
diff options
context:
space:
mode:
authorPatrick J Cherry <patrick@bytemark.co.uk>2014-10-31 12:27:23 +0000
committerPatrick J Cherry <patrick@bytemark.co.uk>2014-10-31 12:27:23 +0000
commitf69e4f9cb95b47b4c7db9f93eb1a5c6e2652186e (patch)
treeb9f7b088413864d5295f5adde4c7408159ee9a76 /byteback-backup
parent1f0025394b3489688fda2f78d6cd468201fd2e0a (diff)
Don't lock the process before help can be shown. Keep args the same as they used to be.
Diffstat (limited to 'byteback-backup')
-rwxr-xr-xbyteback-backup24
1 files changed, 15 insertions, 9 deletions
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]