Bug 1027043 - Snapper Not Cleaning Up Older Snapshots
Summary: Snapper Not Cleaning Up Older Snapshots
Status: NEW
Alias: None
Product: openSUSE Tumbleweed
Classification: openSUSE
Component: Basesystem (show other bugs)
Version: Current
Hardware: x86-64 SUSE Other
: P5 - None : Normal (vote)
Target Milestone: ---
Assignee: Forgotten User kWxJsf0s20
QA Contact: E-mail List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-02-27 10:07 UTC by Antoine Saroufim
Modified: 2017-03-06 11:33 UTC (History)
2 users (show)

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Antoine Saroufim 2017-02-27 10:07:09 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.
Comment 1 Arvin Schnell 2017-02-28 09:40:33 UTC
Please provide output of 'snapper list-configs', 'snapper list' and 'snapper get-config'.
Comment 2 Antoine Saroufim 2017-02-28 11:33:16 UTC
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.
Comment 3 Arvin Schnell 2017-02-28 11:40:18 UTC
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.
Comment 4 Antoine Saroufim 2017-02-28 11:53:40 UTC
The command provided no output at all but it did trim some of the snapshots http://susepaste.org/32538860
Comment 5 Arvin Schnell 2017-02-28 12:00:48 UTC
So it looks as if the cleanup command works fine but is not executed automatic.
Do you have some cron program (cronie) installed?
Comment 6 Antoine Saroufim 2017-02-28 12:04:03 UTC
Yes Cronie came installed by default.
Comment 7 Arvin Schnell 2017-02-28 13:35:10 UTC
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.
Comment 8 Arvin Schnell 2017-03-01 17:09:34 UTC
On my test system the cleanup work fine.

Please provide the output of 'ls -l /var/spool/cron/lastrun' and 'date'.
Comment 9 Antoine Saroufim 2017-03-01 17:16:10 UTC
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
Comment 10 Arvin Schnell 2017-03-01 19:25:31 UTC
Does running '/etc/cron.daily/suse.de-snapper' as root produce any
output and does it cleanup old snapshots?
Comment 11 Antoine Saroufim 2017-03-01 21:56:33 UTC
It yields no output and it does indeed clean up older snapshots.
Comment 12 Arvin Schnell 2017-03-02 08:51:19 UTC
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)?
Comment 13 Antoine Saroufim 2017-03-02 12:04:23 UTC
There's nothing related to cron at all. What if we try to use systemd timers to clean up after snapper instead of cron?
Comment 14 Arvin Schnell 2017-03-06 11:33:35 UTC
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.