If you'd like to take a stab at it, be my guest! I had actually started
outlining the areas of the code that would need to be modified.
If you check out the latest CVS code from the SourceForge repository,
almost all the TODO comments reference this new feature (with the
exception of the background rm feature and a file/directory error check).
As far as the "rsnapshot way", I guess just try to make the new code
look similar to the surrounding code. There isn't an official coding
standards document or anything, but what is in the codebase is fairly
consistent. I guess also avoiding _excess_ cleverness might be another
guideline, since it makes debugging quite difficult later :)
Basically, here is the general idea. Comments from others on the
viability of this plan are also welcome and encouraged! :)
We create a new, optional config file parameter called "sync_first". If
enabled, this will create a directory called "sync" inside the
snapshot_root. When enabled, the lowest interval call (i.e. rsnapshot
hourly) will pull files from the sync directory, NOT the main
filesystem. Ditto for backup_scripts export data.
A new command is added to rsnapshot: "sync". I.E. rsnapshot daily,
rsnapshot help, rsnapshot sync.
If "sync_first" is commented out or otherwise disabled, the sync command
returns a warning and exits (sync_first not enabled, etc). rsnapshot
otherwise behaves exactly as it does now, syncing files from the
filesystem and backup scripts when called with the lowest interval
(rsnapshot hourly, etc).
If sync_first is enabled, sync operations must be done as an additional
"sync" step. This would have to be added as an additional entry in cron,
before the interval entries. The "sync" operation copies backup points
and backup script output into the sync_root, similar to how it works now
on the lowest intervals. However, with "sync", no files would ever be
rotated. When rsnapshot is called with it's lowest interval (hourly,
etc), files are synced from the snapshot_root/sync/ directory, instead
of the main filesystem. backup_scripts will only be run during "sync"
calls. I imagine this would be done with the "cp -al" method, but
haven't thought _too_ much about it yet.
OK, that's it in a nutshell. If you're still interested, and/or you have
any comments, questions, or objections, I'd love to hear them
(especially if I overlooked something stupid!)