diff options
Diffstat (limited to 'backup.in')
-rwxr-xr-x | backup.in | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -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[@]}" | \ |