-
Notifications
You must be signed in to change notification settings - Fork 140
Description
Is your feature request related to a problem? Please describe.
I sometimes find myself looking at the rsync-log-changes file to see what has changed between backups, however I have realised that it isn't accurate if the previous backup has been deleted. As someone who runs a custom script to automate marking old backups for deletion this results in most backups older than a couple days having a log file that only contains a tiny fraction of the actual changes between it and the previous available backup.
Describe the solution you'd like
When deleting a backup, timeshift could prepend the current rsync-log-changes file to the next backup's rsync-log-changes file. This would ensure that the file continues to show an accurate list of changes regardless of the last backup's state. The full rsync-log file would remain untouched since that contains a lot of additional info for debugging purposes, while rsync-log-changes only contains the list of changed files. If there are concerns about this breaking existing systems/causing confusion/making backups take longer, it could be added as a setting that's off by default. That being said, backups taking longer could be mitigated by appending the new backup's rsync-log-changes to the old file and then moving it to replace the newer backup changelog (aka the vala equivalent of cat newBackup/rsync-log-changes >> oldBackup/rsync-log-changes ; mv oldBackup/rsync-log-changes newBackup/rsync-log-changes) instead of prepending (though if you want to both remove duplicates and keep the list sorted appending won't be a solution as the vala equivalent of cat oldBackup/rsync-log-changes newBackup/rsync-log-changes | sort | uniq > newBackup/rsync-log-changes-temp ; mv newBackup/rsync-log-changes-temp newBackup/rsync-log-changes would be needed instead).
Describe alternatives you've considered
I could try to modify my script to do this on it's own, however that would combine the logs before the backup is deleted (since it only marks backups for deletion) and it also wouldn't fix backups that were removed manually through timeshift's GUI.