Skip to content

Instantly share code, notes, and snippets.

@winny-
Last active July 18, 2020 01:25
Show Gist options
  • Save winny-/daa9bdf5803017ae36bd418def2c603d to your computer and use it in GitHub Desktop.
Save winny-/daa9bdf5803017ae36bd418def2c603d to your computer and use it in GitHub Desktop.
a wrapper script & config file for borgmatic backups of a gentoo host
command="borg serve --restrict-to-repository /mnt/backup/snowcrash/repository.borg",restrict ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQC8SWIIOpimeXVMhzaAy20tS3bY5b1IfZwNS/S8yz2pHGPdBtDQtcpXtNWXqNaQD+pIKbJzTDC2KzG2wCYvrOkw08mPb0YhLttHMllyU1AAKXCD4c3CWCe0b3Qerr6YbeJRpHBc1LCtv3hd/DltbgrXC8wJpKywd0C+TYLnJ0uBATx/+VUhQY/mXoLYwsdG1T+9Yw0v8iVnmDn4vGcdfoWnn43TOiVpoAAI0ERa5+PoIYpuWh2ZHJwXlFW05+3toHf4q/IJM6fUbYuCuj0MW7dTzFuIOm/EbWfgyD1SoKbSzdtiCpzwfDVGFsVvkMCJT2qb/+h8bIdVuZrAEJcgA1N7xYkmeL8zOVr7A3HAaJIiBGXmHuiXyl6tpuZ2y8kb4mQ+l9ymQhLaHd+kipGhZYwDySl6r3grg/qk14WPP1orNPPjA/1zzz2bqJxveKN4/1/8KEpZFpF7CarIxeocO3/N0fKwh+StmGeIu8Dt4fu7TYFgP8kZlJLv5GkO2/2OJJ0= root@snowcrash
#!/bin/sh
if [ -e /root/inhibit-backup ]; then
f=
[ -t 2 ] && f='-s'
logger $f "$0: /root/inhibit-backup exists, skipping backup"
exit
fi
/usr/bin/borgmatic -c /etc/borgmatic/snowcrash.yaml "$@"
location:
source_directories:
- /home
- /etc
- /var/db/pkg
- /var/log
- /var/spool
- /var/lib/portage
- /root
repositories:
- [email protected]:repository.borg
one_file_system: true
retention:
keep_daily: 7
keep_weekly: 4
keep_monthly: 6
consistency:
checks:
- repository
- archives
storage:
ssh_command: ssh -i /etc/borgmatic/keys/snowcrash/ssh
encryption_passcommand: cat /etc/borgmatic/keys/snowcrash/repokey
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment