Backup
Jan 4, 2017 · 1 minute read · Comments
Post
Tag:
tech
Attic backup
Borg backup
borg init --encryption=repokey /path/to/repo
#!/bin/sh
REPOSITORY=/mnt/d/Backup/my-backup.borg
LOGFILE=/mnt/d/Backup/log.log
BORG=/mnt/d/Borg/borg
export BORG_PASSPHRASE=PASSPHRASE
exec >> $LOGFILE 2>&1
#List all archives: borg list /path/to/repo
#Restore archive: borg extract /path/to/repo::Monday
#simple function that just prints the time and the info you pass to it
echotime () {
echo "$1 `date +%Y-%m-%d--%H:%M:%S`"
}
echotime "BORG CREATE"
$BORG create -v --stats -C zlib,6 \
$REPOSITORY::backup-`date +%Y-%m-%d`\
/mnt/d/Books/ \
/mnt/d/Source/ \
/mnt/d/Photo/
# --exclude /home/*/.cache
echotime "BORG PRUNE"
$BORG prune -v --stats $REPOSITORY --keep-monthly=4
echo
D:\Cloud\Cloud.exe
timeout 3
bash -c "/mnt/d/Borg/backup.sh"