System backups with BorgBackup and BorgBase

2020/09/23 by Paulo Pereira

~/categories/Linux #Linux #Arch Linux #BorgBackup #BorgBase

Since my last post on BorgBackup and BorgBase, I have subscribed to a 1 TB annual plan and have my daily and weekly /home backups running.

The next thing to setup is my system backups. For this (for now) I’m using a more weekly manually approach.


sudo pacman -S borg


sudo ssh-keygen -o -a 100 -t ed25519
sudo cat /root/.ssh/

Here you must choose a strong password.

sudo borg init --encryption=repokey-blake2


Every time you want to create a new backup just execute:

sudo borg create --list --progress --info --log-json --json --filter=AM -C lz4 --exclude '/root/.ssh/'{now:%Y-%m-%dT%H:%M:%S} /etc /var /root /opt

Checking your archives

You can list the archives or files you have and mount them to explore the backed up files.

sudo borg list
sudo borg list
mkdir /tmp/mount
sudo borg mount /tmp/mount
sudo ls /tmp/mount
sudo ls -l /tmp/mount/etc/fstab
sudo borg umount /tmp/mount

Cleaning your archives

It’s also a good idea to prune your repository to clean out older files.

sudo borg prune -v --list --stats --keep-within=10d --keep-weekly=4 --keep-monthly=6 --keep-yearly=2