From 903564349edb8e2ef457a5dbf09d3ed9c9c206f5 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Tue, 11 Oct 2016 13:32:46 +0200 Subject: alle manpages sollten jetzt funktionieren --- backup.in | 36 ++++++++++++++++++++++++++++-------- 1 file changed, 28 insertions(+), 8 deletions(-) (limited to 'backup.in') diff --git a/backup.in b/backup.in index 0a61933..33a59f3 100755 --- a/backup.in +++ b/backup.in @@ -1,18 +1,38 @@ #!/bin/bash -. #ETCDIR#/backup.conf +[ -r "#ETCDIR#/backup.conf" ] && \ + . "#ETCDIR#/backup.conf" usage() { - >&2 echo 'This is backup version #VERSION#' - >&2 echo '' - >&2 echo 'usage:' - >&2 echo ' backup /tmp/pidFile /path/to/destination/ user@source:path' - >&2 echo ' backup /tmp/pidFile /path/to/destination/ user@source:path proxy_user@ssh_host' - >&2 echo 'or as a symlink (e.g. in /etc/cron/daily) named after a key of $backups in #ETCDIR#/backup.conf without arguments' - exit 1 + >&2 echo \ +'Usage: backup /tmp/pidFile /path/to/destination/ user@source:path [proxy_user@ssh_host] +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. + +Options: + /tmp/pidFile location of file to store PID in + /path/to/destination location to store backups in + user@source:path remote data to back up + proxy_user@ssh_host ssh login to proxy node (optional) +#HELPTEXT# #' + [ -z "$1" ] && exit 1 + exit $1 } +if [ $# -eq 1 ] +then + if [ "$1" == "--help" ] + then + usage 0 + elif [ "$1" == "--version" ] + then + echo '#VERSION#' + exit + fi +fi + if [ $# -eq 0 ] then backupID="$(basename $0)" -- cgit v1.2.3-54-g00ecf