diff --git a/bin/backup-tor.sh b/bin/backup-tor.sh new file mode 100644 index 0000000..af57ec2 --- /dev/null +++ b/bin/backup-tor.sh @@ -0,0 +1,13 @@ +#!/usr/bin/env bash + +# needs to run as root +# +# setup as cron job: +# +# sudo crontab -e +# 0 2 * * * /bin/backup-tor.sh + +# Create a time-stamped .tar file in the current directory. +# The .tar file will be readable only to root. +cd /home/root/backups/ || exit +sh -c 'umask 0077; tar -cf $(date "+%s-%F-var-lib-tor.tar") -C / var/lib/tor' \ No newline at end of file