We now have --skip-if-unchanged, which prevents empty snapshots from being created, but we still have older empty snapshots that are there from before we started using it.
Could it be possible to remove these somehow? Maybe with a prune option or something?
There’s currently no option to remove duplicate snapshots (besides telling forget which specific snapshots to remove). Feel free to open a Github issue with a feature request.
Yes, I used it all the time, i.e. for all Restic-Versions starting from 3 years ago until the Restic-Version which offers this new option --skip-if-unchanged.
Since then I didn’t need the script any more (note that all ‘duplicate’ backups in the past have already been cleaned up).
Another note: On on of my (server)-directories I do a Restic-Backup once per hour. This leads (or better: leaded) to a lot of duplicates and was the main motivation to write this scipt.
Note also that the script is “dry run” - i.e. it does not “forget” any snapshort automatically. It just prints the appropriate “restic forget” command. It also prints a whole list of all snapshots (chronologically) and it’s decission if this or that is a duplicate of the ‘previous’ one - or not.