do-backup.sh 647 B

12345678910111213141516171819202122232425262728293031
  1. BORG_GENERAL_OPTIONS="--show-rc --show-version --info"
  2. # Report start of backup to prom
  3. notify-prom-status.sh start
  4. # Run backup
  5. borg $BORG_GENERAL_OPTIONS \
  6. create \
  7. --stats \
  8. --one-file-system \
  9. --exclude-if-present .backupignore \
  10. --keep-exclude-tags \
  11. $BORG_REPO::$BORG_HOSTNAME-{now} \
  12. $BORG_SOURCE_PATH
  13. # Report backup exit code to prom
  14. notify-prom-status.sh $?
  15. # Prune old backups
  16. borg $BORG_GENERAL_OPTIONS \
  17. prune \
  18. $BORG_RETENTION \
  19. $BORG_REPO
  20. # Free space by compacting segments
  21. borg $BORG_GENERAL_OPTIONS \
  22. compact \
  23. $BORG_REPO
  24. # Report backup statistics to prom
  25. notify-prom-stats.sh