Conversation
* Similar to cmd_cp it allows the user to customize the command that gets called whenever a backup directory gets created, e.g. '.sync' or 'interval.0'. * This only applies to created backup directories, not to all created directories, i.e. the root directory will still be created with mkpath.
|
@nioncode Thanks for keeping your clone open for all these years! Is there any chance you're still interested in having this merged and could write some tests for these changes? |
|
I don't have any experience with BTRFS to see at a glance why this is useful. But since it is a fairly large change, necessary to have tests. |
|
It's useful, because as stated in the original post, it can significantly reduce backup times when using btrfs as Unfortunately, I don't have enough time to add test cases for this (and personally I don't use rsnapshot anymore). The only thing I can say is that I used my fork for over 3 years without any problems. Further, the code only changes the behavior of rsnapshot if the |
This implements the proposed cmd_mkbackupdir option from #20.
Previously, you'd have to create btrfs subvolumes for possible snapshot directories (.sync and lowest_interval.0) for all hosts manually before running rsnapshot for the first time.
Now, you can point cmd_mkbackupdir to an executable that creates the directory for you whenever its needed.
This allows us to take advantage of btrfs features:
Overall, this reduces the backup time to the differential rsync operation, all additional IO operations are now instant.
Previously, my hourly backup rotation (+ deletion of old backups) took 17s for my server and 4m7s for my desktop backup. Both of them are now done in one second.
The more files you have in your backup, the more time you will save.
Note: At the beginning, I used read-only snapshots, but this breaks when the .sync directory is missing and gets recreated from the latest snapshot. Then, the .sync directory would have been read-only and rsync fails.
I am using this with the following config options:
rsnapshot-cp-btrfs:
rsnapshot-rm-btrfs:
rsnapshot-mkbackupdir-btrfs