diff options
author | Erich Eckner <git@eckner.net> | 2016-10-11 13:32:46 +0200 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2016-10-11 14:24:11 +0200 |
commit | 903564349edb8e2ef457a5dbf09d3ed9c9c206f5 (patch) | |
tree | ef7a476c37e967d4df02ed21d5b38d4c9944d09e /backup.in | |
parent | 42b083a197c3d29cce74c22606e16317f18f808b (diff) | |
download | hardlinkedBackups-903564349edb8e2ef457a5dbf09d3ed9c9c206f5.tar.xz |
alle manpages sollten jetzt funktionieren
Diffstat (limited to 'backup.in')
-rwxr-xr-x | backup.in | 36 |
1 files changed, 28 insertions, 8 deletions
@@ -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)" |