I am currently using restic to backup an email archive that lives on a btrfs filesystem with snapshots created using snapper. The snapshots make it easy find out which files have changed since the last backup and pass the list to restic using a --files-from argument.
snapper -c mail_dirs create --description snap_for_daily_backup snapper -c mail_dirs list | grep snap_for_daily_backup | cut -d '|' --fields=1 snapper -c mail_dirs diff --diff-cmd "/usr/bin/diff --new-file --brief" 0..1416 > /tmp/file_diff_list cat /tmp/file_diff_list | perl -lne 'print $_ if s:Files (.*) and (.*) differ:$1:' > /tmp/files2backup.txt restic backup --verbose -o b2.connections=20 --limit-upload=3072 --files-from /tmp/files2backup.txt
The sequence of commands above typically return about one hundred email message files that have changed in the last few hours. As expected the backup of just those messages is quick because restic does not have to examine half a million files to discover that most are unchanged.
My problem is that I now have snapshots in my backup that lists all those file paths, instead of just another neat backup of /home/mail_dirs like all the other backups.
Is there a way to run the backup so that it will be stored as another snapshot of the same directory, but to pass in a list of file that I know have changed in order to bypass restic’s directory walking code?