baodrate / snap-sync

Use snapper snapshots to backup to external drive
GNU General Public License v2.0
130 stars 38 forks source link

Cleanup old snap-sync snapshot #82

Closed cmonty14 closed 3 years ago

cmonty14 commented 4 years ago

Hi, checking the available snapshots for a config I get a list that includes many snapshots with description "old snap-sync snapshot (you may remove)".

vlccirax:~ # snapper -c x86_64-efi list
Type   | #  | Pre # | Date                     | User | Cleanup | Description                             | Userdata
-------+----+-------+--------------------------+------+---------+-----------------------------------------+----------------------------------------------------------------------------
single | 0  |       |                          | root |         | current                                 |
single | 13 |       | Sun May 24 00:00:03 2020 | root | number  | old snap-sync snapshot (you may remove) |
single | 14 |       | Mon May 25 00:00:04 2020 | root | number  | old snap-sync snapshot (you may remove) |
single | 15 |       | Tue May 26 00:00:02 2020 | root | number  | old snap-sync snapshot (you may remove) |
single | 16 |       | Wed May 27 00:00:02 2020 | root | number  | old snap-sync snapshot (you may remove) |
single | 17 |       | Thu May 28 00:00:02 2020 | root | number  | old snap-sync snapshot (you may remove) |
single | 18 |       | Fri May 29 00:00:02 2020 | root | number  | old snap-sync snapshot (you may remove) |
single | 19 |       | Sat May 30 00:00:02 2020 | root | number  | old snap-sync snapshot (you may remove) |
single | 20 |       | Sun May 31 00:00:03 2020 | root | number  | old snap-sync snapshot (you may remove) |
single | 21 |       | Mon Jun  1 00:00:03 2020 | root | number  | old snap-sync snapshot (you may remove) |
single | 22 |       | Tue Jun  2 00:00:02 2020 | root | number  | old snap-sync snapshot (you may remove) |
single | 23 |       | Wed Jun  3 00:00:02 2020 | root | number  | old snap-sync snapshot (you may remove) |
single | 24 |       | Thu Jun  4 00:00:03 2020 | root | number  | old snap-sync snapshot (you may remove) |
single | 25 |       | Fri Jun  5 00:00:03 2020 | root | number  | old snap-sync snapshot (you may remove) |
single | 26 |       | Sat Jun  6 00:00:03 2020 | root | number  | old snap-sync snapshot (you may remove) |
single | 27 |       | Sun Jun  7 00:00:03 2020 | root | number  | old snap-sync snapshot (you may remove) |
single | 28 |       | Mon Jun  8 00:00:04 2020 | root | number  | old snap-sync snapshot (you may remove) |
single | 29 |       | Tue Jun  9 00:00:02 2020 | root | number  | old snap-sync snapshot (you may remove) |
single | 30 |       | Wed Jun 10 00:00:03 2020 | root | number  | old snap-sync snapshot (you may remove) |
single | 31 |       | Thu Jun 11 00:00:02 2020 | root | number  | old snap-sync snapshot (you may remove) |
single | 32 |       | Fri Jun 12 00:00:03 2020 | root | number  | old snap-sync snapshot (you may remove) |
single | 33 |       | Sat Jun 13 00:00:03 2020 | root | number  | old snap-sync snapshot (you may remove) |
single | 34 |       | Sun Jun 14 00:00:02 2020 | root | number  | old snap-sync snapshot (you may remove) |
single | 35 |       | Mon Jun 15 00:00:05 2020 | root | number  | old snap-sync snapshot (you may remove) |
single | 36 |       | Tue Jun 16 00:00:02 2020 | root | number  | old snap-sync snapshot (you may remove) |
single | 37 |       | Wed Jun 17 00:00:03 2020 | root | number  | old snap-sync snapshot (you may remove) |
single | 38 |       | Thu Jun 18 00:00:02 2020 | root | number  | old snap-sync snapshot (you may remove) |
single | 39 |       | Fri Jun 19 00:00:03 2020 | root | number  | old snap-sync snapshot (you may remove) |
single | 40 |       | Sat Jun 20 00:00:03 2020 | root | number  | old snap-sync snapshot (you may remove) |
single | 41 |       | Sun Jun 21 00:00:03 2020 | root | number  | old snap-sync snapshot (you may remove) |
single | 42 |       | Mon Jun 22 00:00:03 2020 | root | number  | old snap-sync snapshot (you may remove) |
single | 43 |       | Tue Jun 23 00:00:02 2020 | root | number  | old snap-sync snapshot (you may remove) |
single | 44 |       | Wed Jun 24 00:00:02 2020 | root | number  | old snap-sync snapshot (you may remove) |
single | 45 |       | Thu Jun 25 00:00:03 2020 | root | number  | old snap-sync snapshot (you may remove) |
single | 46 |       | Fri Jun 26 00:00:02 2020 | root | number  | old snap-sync snapshot (you may remove) |
single | 47 |       | Sat Jun 27 00:00:03 2020 | root | number  | old snap-sync snapshot (you may remove) |
single | 48 |       | Sun Jun 28 00:00:02 2020 | root | number  | old snap-sync snapshot (you may remove) |
single | 49 |       | Mon Jun 29 00:00:05 2020 | root | number  | old snap-sync snapshot (you may remove) |
single | 50 |       | Tue Jun 30 00:00:02 2020 | root | number  | old snap-sync snapshot (you may remove) |
single | 51 |       | Wed Jul  1 00:00:03 2020 | root | number  | old snap-sync snapshot (you may remove) |
single | 52 |       | Thu Jul  2 00:00:03 2020 | root | number  | old snap-sync snapshot (you may remove) |
single | 53 |       | Fri Jul  3 00:00:03 2020 | root | number  | old snap-sync snapshot (you may remove) |
single | 54 |       | Sat Jul  4 00:00:03 2020 | root | number  | old snap-sync snapshot (you may remove) |
single | 55 |       | Sun Jul  5 00:00:03 2020 | root | number  | old snap-sync snapshot (you may remove) |
single | 56 |       | Mon Jul  6 00:00:03 2020 | root | number  | old snap-sync snapshot (you may remove) |
single | 57 |       | Tue Jul  7 00:00:02 2020 | root | number  | old snap-sync snapshot (you may remove) |
single | 58 |       | Wed Jul  8 00:00:03 2020 | root | number  | old snap-sync snapshot (you may remove) |
single | 59 |       | Thu Jul  9 00:00:03 2020 | root | number  | old snap-sync snapshot (you may remove) |
single | 60 |       | Fri Jul 10 00:00:03 2020 | root | number  | old snap-sync snapshot (you may remove) |
single | 61 |       | Sat Jul 11 00:00:03 2020 | root | number  | old snap-sync snapshot (you may remove) |
single | 62 |       | Sun Jul 12 00:00:03 2020 | root | number  | old snap-sync snapshot (you may remove) |
single | 63 |       | Mon Jul 13 00:00:05 2020 | root |         | latest incremental backup               | backupdir=vlccirax, subvolid=257, uuid=d3a0bde3-5c52-43a1-9786-a4f0a5db3c3d

I think it would make sense to cleanup these snapshots automatically. Otherwise you run into risk that filesystem is marked as full.

This request is related to issue #74.

Regards Thomas

wesbarnett commented 4 years ago

The number algorithm should clean them up automatically once they go beyond the number you have set in your settings.

NicoHood commented 4 years ago

I guess this is a duplicate of https://github.com/wesbarnett/snap-sync/issues/74

I also strongly recommend adding an option to delete those.

wesbarnett commented 3 years ago

Duplicate of #74 . Working on an update to resolve this.