diff options
| author | Marc Vertes <mvertes@free.fr> | 2020-06-10 22:22:22 +0200 |
|---|---|---|
| committer | Marc Vertes <mvertes@free.fr> | 2020-06-10 22:22:22 +0200 |
| commit | 1eaeadf7c8cdf74f1d8edf6e892e408f4d98662d (patch) | |
| tree | 1821bc5a650f54760fa271e666925e63fbdc7f63 /bin/backup | |
| parent | bc43abee15ba8634fba1d279a3c8378111501960 (diff) | |
update
Diffstat (limited to 'bin/backup')
| -rwxr-xr-x | bin/backup | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -1,10 +1,12 @@ #!/bin/sh +[ "$USER" = root ] || exec sudo "$0" "$@" + # incremental backup using rsync(1) die() { echo "$0: fatal: $@" >&2; exit 1; } -[ "$(id -u)" = 0 ] || die must run as root +#[ "$(id -u)" = 0 ] || die must run as root while getopts :v opt; do case $opt in @@ -14,7 +16,6 @@ while getopts :v opt; do done shift $((OPTIND - 1)) -#dest=${1:-/backup/$(hostname)} dest=${1:-/.history} date=$(date +%Y%m%d_%H%M%S) last=$(rsync --list-only $dest/ 2>/dev/null | cut -b 47- | tail -1) |
