The idea is to use systemd to run a script when external harddisk is plugged-in. The script is in charge of creating a new Btrfs snapshot (the script relies on a simple external script). In my case, my harddisk is fully encrypted (using LUKS) and the device is automaticaly mounted by GNOME (the decryption key is stored in GNOME’s keyring).
- Prepare your harddisk (create a LUKS partition and a Btrfs partition inside it).
- Install rsyncbtrfs.
- Mount your backup harddisk.
- Initialize your backup partition:
rsyncbtrfs init /media/xxx/backup
.