reddit / emacs

Time based rules for file backup?

copperbranch · 2022-09-24 16:16
I would like create the following setup: * Every day that I edit and save a file, create a backup for the file as it was before the edit. (I believe that is already how backup files work, correct?) * Keep all the existent backup versions of the past 7 days. * Keep one backup version per week of backup files older than 7 days. * Keep one backup version per month of backup files older than 30 days. * Keep one backup version per trimester of backup files older than 90 days. Is there tool that does something similar? If not, what would be my first steps to try this? I didn't see anything in the Backup Files section of the manual that could help me with this.
akirakom · 2022-09-24 16:31
Automated snapshots of ZFS support that, except that there is no quarterly interval.
franburstall · 2022-09-24 16:41
You could probably roll your own versions of `make-backup-file-name` and `find-backup-file-name`. See section 27.1.4 of the Emacs Lisp Reference Manual.
jsled · 2022-09-24 17:04
zfs-auto-snapshot
copperbranch · 2022-09-24 19:07
Thank you! I’ll take a look at it. The quarterly interval is not set in stone, I can adapt to different ones.