summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xbackup.in9
1 files changed, 7 insertions, 2 deletions
diff --git a/backup.in b/backup.in
index 6723699..bfe3e61 100755
--- a/backup.in
+++ b/backup.in
@@ -15,6 +15,7 @@ usage()
Backup files from remote with rsync, possibly via SSH-tunnel.
With no arguments, information is expected to be in array $backups in #ETCDIR#/backup.conf with name of executable (e.g. a symlink) as key.
+With one argument, information is expected to be in array ${backups[$1]} in #ETCDIR#/backup.conf.
Options:
/tmp/pidFile location of file to store PID in
@@ -36,8 +37,12 @@ if [ $# -eq 1 ]; then
fi
seldom=false
-if [ $# -eq 0 ]; then
- backupID="$(basename $0)"
+if [ $# -eq 0 ] || [ $# -eq 1 ]; then
+ if [ $# -eq 0 ]; then
+ backupID="$(basename $0)"
+ else
+ backupID="$1"
+ fi
[ -z "${backups[${backupID}]}" ] && usage
set /tmp/${backupID}.pid ${backups[${backupID}]}
if printf '%s\n' "${seldomBackups[@]}" | \