Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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