btrbk
btrbk copied to clipboard
Group active backing up images to DATE not SUBVOLUME.
As an experiment I recently switched to btrbk snapshots every 5 minutes from 60 minutes. When I run the nightly "send all my backups to my servers backup disk" it takes a lot longer of course, as estimated.
I have four subvolumes that are being backed up: root, home, boot and data. On root is my OS, on home is /home, on boot I rsync -avr --delete
my /boot (ext2) drive before every backup and on /data is my Music and Movie collection.
So with my backups taking a lot longer now to the external file server and my data being seperated in this way, I noticed that btrbk is syncing snapshots first by name and only then by date, like this:
root_at_time_1
root_at_time_2
root_at_time_3
root_at_time_4
home_at_time_1
home_at_time_2
home_at_time_3
home_at_time_4
boot_at_time_1
boot_at_time_2
boot_at_time_3
boot_at_time_4
data_at_time_1
data_at_time_2
data_at_time_3
data_at_time_4
It would be better for consistency if it was in this order:
root_at_time_1
home_at_time_1
boot_at_time_1
data_at_time_1
root_at_time_2
home_at_time_2
boot_at_time_2
data_at_time_2
root_at_time_3
home_at_time_3
boot_at_time_3
data_at_time_3
root_at_time_4
home_at_time_4
boot_at_time_4
data_at_time_4
Also I am sorry for ALL CAPS, I just don't know how to highlight words in a caption. Not intended to be interpreted as shouting :)
I'm afraid this is not easily doable. The main reason why it is implemented like this is to have an abort condition per source subvolume (if first backup fails, abort all consequent ones), which would make things a bit more complicated when resorting.
I'll leave this issue open as feature request, maybe it will be considered for a refactoring some day.
Why not simply change your backup script to the n numbers before the name?
at_time_1_home
Ok.. three years later 😃 I would like to have DATE or (time stamp) as an additional snapshot subdirectory so in the above example, snapshot_dir/time_1/{root,home,boot, data} snapshot_dir/time_2/{root,home,boot,data} etc..
This is in my opinion much cleaner than a big list of subvolume.timestamp names, especially when you have a lot of subvolumes and timestamps...
I have been looking at a similar enhancement request, #304 and seeing the patch over there I think I can put this together myself.