Comments on 2017-12-24 Borg Backup

Moin Alex, nice post!

Some comments:

“you have to mkdir /mnt/backup/borg-backups before creating the repo”

borg creates the repo dir if it does not exist, but maybe it does not create missing parent dirs of it. Not sure if that would be an improvement if it did, esp. considering typos.

--checkpoint-interval 86400

be careful with a that long checkpoint interval. you will lose up to a day of “backup work” if the connection breaks down before finishing.

DATE=$(date --iso-8601)-$(hostname)

borg can expand {utcnow}-{hostname} internally.

borg --version

borg create ... --show-version ... (similar to --show-rc)

borg prune: maybe add --stats so it tells how much repo space it freed.

systemd issues: no idea

Cheers, Thomas

Thomas Waldmann 2017-12-29 01:08 UTC

Thank you for the comments!

I read up on the various options and changed the script to now run as follows:

borg create                         \
     --stats                        \
     --one-file-system              \
     --compression lz4              \
     --show-version                 \
     --exclude /root/.cache         \
     --exclude /var/cache           \
     $TARGET::{utcnow}-{hostname}   \

borg prune                          \
     --stats                        \
     --list                         \
     --show-rc                      \
     --keep-daily    7              \
     --keep-weekly   4              \
     --keep-monthly  6              \

– Alex 2017-12-29 13:20 UTC

As a reminder to myself: what to do when you want to add another disk to your rotating disk schedule?

  1. I used the disk utility to format and partition the backup disk. Partitioning: GUID Partition Table. Volume: Ext4.
  2. mkdir /mnt/backup/borg-backups/
  3. borg init --encryption=repokey --progress /mnt/backup/borg-backups/backup.borg
  4. use the same password as I provided in /etc/backups/
  5. use lsblk --list --output=uuid,mountpoint to find the new UUID
  6. add this UUID to /etc/backups/backup.disks

Unmount the disk and unplug it, then plug it again and look at the output of sudo journalctl -fu automatic-backup.

– Alex Schroeder 2018-02-08 07:06 UTC

Make sure you check the journal! Today I ran sudo journalctl -fu automatic-backup and saw:

Feb 16 14:14:18 melanobombus systemd[1]: Starting automatic-backup.service...
Feb 16 14:14:24 melanobombus[1728]: No backup disk found, exiting
Feb 16 14:14:24 melanobombus systemd[1]: Started automatic-backup.service.

I was confused but finally decided to just try again, running sudo umount /mnt/backup and unplugging the disk, plugging it back in again, and then it worked:

Feb 16 14:22:28 melanobombus systemd[1]: Starting automatic-backup.service...
Feb 16 14:22:33 melanobombus[3102]: Disk 156cf4df-aa58-421e-b3d0-583fe6fdff4a is a backup disk
Feb 16 14:22:33 melanobombus[3102]: /dev/sdb1 on /mnt/backup type ext4 (rw,nosuid,nodev,relatime,data=ordered,x-gvfs-show)
Feb 16 14:22:33 melanobombus[3102]: Drive path: /dev/sdb1


– Alex Schroeder 2018-02-16 13:24 UTC

Please make sure you contribute only your own work, or work licensed under the GNU Free Documentation License. Note: in order to facilitate peer review and fight vandalism, we will store your IP number for a number of days. See Privacy Policy for more information. See Info for text formatting rules. You can edit this page if you need to fix typos. You can subscribe to updates by email without leaving a comment.

To save this page you must answer this question:

Please say HELLO.