diff --git a/arch-desktop_borg.sh b/arch-desktop_borg.sh index a00d03e..27326a8 100755 --- a/arch-desktop_borg.sh +++ b/arch-desktop_borg.sh @@ -27,15 +27,19 @@ stat_cache_file() { echo "The borg backup was already executed today" && exit 0 fi fi - touch "$cache_file" } if [ "$1" = '-h' ]; then print_help && exit 1 fi +if [ ! "$UID" -eq 0 ]; then + echo "You have to run this as root" && exit 1 +fi + [ "$1" = '-f' ] || stat_cache_file +touch "$cache_file" # Setting this so the repo does not need to be given on the command line: BORG_REPO=ssh://flyingscorpio@2px.info:22/~/"$(hostname)".borg export BORG_REPO