From 1eaeadf7c8cdf74f1d8edf6e892e408f4d98662d Mon Sep 17 00:00:00 2001 From: Marc Vertes Date: Wed, 10 Jun 2020 22:22:22 +0200 Subject: update --- bin/backup | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'bin/backup') diff --git a/bin/backup b/bin/backup index cc98d63..3f1d586 100755 --- a/bin/backup +++ b/bin/backup @@ -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) -- cgit v1.2.3