Bugzilla – Bug 1027043
Snapper Not Cleaning Up Older Snapshots
Last modified: 2017-03-06 11:33:35 UTC
Snapper has accumulated 700 snapshots in one week and hasn't cleaned almost any of them. The partition became nearly full (97% full) due to that. Checking up on systemd's cleanup services, it seemed that they are still around and do their duty once per day but they are seemingly not configured to clean up unimportant pre and post snapshots when they exceed a certain number.
Please provide output of 'snapper list-configs', 'snapper list' and 'snapper get-config'.
snapper list-configs: Config | Subvolume -------+---------- root | / snapper list: http://susepaste.org/10015305 snapper get-config: Key | Value -----------------------+------ ALLOW_GROUPS | ALLOW_USERS | BACKGROUND_COMPARISON | yes EMPTY_PRE_POST_CLEANUP | yes EMPTY_PRE_POST_MIN_AGE | 1800 FSTYPE | btrfs NUMBER_CLEANUP | yes NUMBER_LIMIT | 10 NUMBER_LIMIT_IMPORTANT | 10 NUMBER_MIN_AGE | 1800 SUBVOLUME | / SYNC_ACL | no TIMELINE_CLEANUP | yes TIMELINE_CREATE | no TIMELINE_LIMIT_DAILY | 1 TIMELINE_LIMIT_HOURLY | 0 TIMELINE_LIMIT_MONTHLY | 1 TIMELINE_LIMIT_YEARLY | 1 TIMELINE_MIN_AGE | 1800 Please note that I changed the configs and deleted over 500 snapshots manually. The default configs were 10 per day 10 per week 10 per month and 10 per year.
The numbers for the timeline do not matter since TIMELINE_CREATE is no. Try to run as root 'snapper --no-dbus cleanup number' and provide any output and check snapshots afterwards.
The command provided no output at all but it did trim some of the snapshots http://susepaste.org/32538860
So it looks as if the cleanup command works fine but is not executed automatic. Do you have some cron program (cronie) installed?
Yes Cronie came installed by default.
I have now installed Tumbleweed 20170226 and set TIMELINE_CREATE=yes. On that system the hourly snapshots are created. Tomorrow I can check whether the daily cleanup was executed.
On my test system the cleanup work fine. Please provide the output of 'ls -l /var/spool/cron/lastrun' and 'date'.
ls -l /var/spool/cron/lastrun -rw-r--r-- 1 root root 0 Mar 1 14:45 cron.daily -rw-r--r-- 1 root root 0 Mar 1 19:00 cron.hourly -rw-r--r-- 1 root root 0 Feb 23 21:16 cron.monthly -rw-r--r-- 1 root root 0 Feb 23 21:15 cron.weekly Date Wed Mar 1 19:15:53 EET 2017
Does running '/etc/cron.daily/suse.de-snapper' as root produce any output and does it cleanup old snapshots?
It yields no output and it does indeed clean up older snapshots.
Frankly I'm out of ideas now: According to the data in /var/spool cron.daily is running and the script in cron.daily works when run manually. Are there any mails for root (e.g. cron failures)?
There's nothing related to cron at all. What if we try to use systemd timers to clean up after snapper instead of cron?
Since the problem does not seem to be a generic problem I move the bug to the yast community list. Anyone can help with debugging. I would try to add logger messages in the scripts and enable debug messages from corn. You are of course free to use systemd instead of cron.