added backup script

This commit is contained in:
Harri Lahtinen 2019-09-01 00:48:33 +03:00
parent 90d56b5787
commit a37ce04b87
1 changed files with 31 additions and 0 deletions

31
.config/Scripts/backup.sh Executable file
View File

@ -0,0 +1,31 @@
#!/bin/sh
echo "Starting backup for `date`\n"
# setup script variables
#LOCAL=$(hostname --short)
#REPO=ssh://borg@docker1.home.hartzan.com:2222:/backup/arch
HOST=alpine0.home.hartzan.com
#DATE=$(date +Y%-%m-%d)
HOME=/home/hate
TAG=daily
# create borg backup archive
borg create ssh://borg@$HOST:2222/backup/arch::$TAG'-{now:%Y-%m-%d}' $HOME --exclude $HOME/.cache --exclude $HOME/Downloads
# prune old archives to keep disk space in check
borg prune -v ssh://borg@$HOST:2222/backup/arch --prefix $TAG'-' --keep-daily=7 --keep-weekly=4 --keep-monthly=6
# all done!
echo "Backup complete at `date`\n";