I recently set up Snapper for my system (following this guide that was linked in a previous topic I opened about it) for Fedora 34 and it’s doing its job, but I am currently having a hard time with the options. It looks like the scheduler does not clean up the timeline according to my settings, as I currently have 83 snapshots on my system:
$ pwd
/etc/snapper/configs
$ sudo cat root
# subvolume to snapshot
SUBVOLUME="/"
# filesystem type
FSTYPE="btrfs"
# btrfs qgroup for space aware cleanup algorithms
QGROUP=""
# fraction of the filesystems space the snapshots may use
SPACE_LIMIT="0.5"
# fraction of the filesystems space that should be free
FREE_LIMIT="0.2"
# users and groups allowed to work with config
ALLOW_USERS=""
ALLOW_GROUPS=""
# sync users and groups from ALLOW_USERS and ALLOW_GROUPS to .snapshots
# directory
SYNC_ACL="no"
# start comparing pre- and post-snapshot in background after creating
# post-snapshot
BACKGROUND_COMPARISON="yes"
# run daily number cleanup
NUMBER_CLEANUP="yes"
# limit for number cleanup
NUMBER_MIN_AGE="1800"
NUMBER_LIMIT="50"
NUMBER_LIMIT_IMPORTANT="10"
# create hourly snapshots
TIMELINE_CREATE="yes"
# cleanup hourly snapshots after some time
TIMELINE_CLEANUP="yes"
# limits for timeline cleanup
TIMELINE_MIN_AGE="1800"
TIMELINE_LIMIT_HOURLY="3"
TIMELINE_LIMIT_DAILY="5"
TIMELINE_LIMIT_WEEKLY="0"
TIMELINE_LIMIT_MONTHLY="0"
TIMELINE_LIMIT_YEARLY="0"
# cleanup empty pre-post-pairs
EMPTY_PRE_POST_CLEANUP="yes"
# limits for empty pre-post-pair cleanup
EMPTY_PRE_POST_MIN_AGE="1800"
Would you be able to point me towards what I am failing to set up?
Additionally (I would normally avoid 2 questions in one post, but they are related), I can’t get to work the bit that Chris Murphy’s mentioned in his post without messing up /etc/fstab/, so if you could please help with that it would be great.
According to the openSUSE Snapper Tutorial the cron scheduler is the default and the systemd service is an alternative. If the timeline snapshots are being made then presumably cron is running correctly?
@fbackstab have you checked in /var/log/snapper.log to see if there are any relevant error messages?
The only thing that looks like it is 2021-06-11 13:35:13 WAR libsnapper(38461) Client.cc(dispatch):1860 - CAUGHT: quota rescan or sync failed
Edit: apparently now it works (just took a while), so I suppose it’s been the systemd service. Now I have both activated, what shall I do? Deactivate the cronie scheduler and retain systemd or vice versa (i.e. fix the cronie one and use systemd as a temporary solution)?
And as you can see, I see no crontab file which would trigger it regularly. Is that something you created on your own?
If you’re following OpenSUSE documentation, beware that some things may be different, after all, although the program is the same, build and package might not be.
The problem here is that things like how job scheduling works is usually a distro specific implementation detail. On Suse, using the cron might be the default but on Fedora, maybe not.
I do not think I created one, is there any way I can check just to be sure?
$ sudo systemctl status crond.service
crond.service - Command Scheduler
Loaded: loaded (/usr/lib/systemd/system/crond.service; enabled; vendor pre>
Active: active (running) since Wed 2021-06-23 12:54:49 BST; 31min ago
Main PID: 1907 (crond)
Tasks: 1 (limit: 38022)
Memory: 1.3M
CPU: 82ms
CGroup: /system.slice/crond.service
└─1907 /usr/sbin/crond -n
Jun 23 12:54:49 fedora crond[1907]: (CRON) INFO (RANDOM_DELAY will be scaled wi>
Jun 23 12:54:49 fedora crond[1907]: (CRON) INFO (running with inotify support)
Jun 23 13:01:01 fedora CROND[5099]: (root) CMD (run-parts /etc/cron.hourly)
Jun 23 13:01:01 fedora anacron[5112]: Anacron started on 2021-06-23
Jun 23 13:01:01 fedora anacron[5112]: Will run job `cron.daily' in 7 min.
Jun 23 13:01:01 fedora anacron[5112]: Jobs will be executed sequentially
Jun 23 13:01:01 fedora CROND[5098]: (root) CMDEND (run-parts /etc/cron.hourly)
Jun 23 13:08:01 fedora anacron[5112]: Job `cron.daily' started
Jun 23 13:08:01 fedora anacron[5112]: Job `cron.daily' terminated
Jun 23 13:08:01 fedora anacron[5112]: Normal exit (1 job run)
$ systemctl status snapperd
○ snapperd.service - DBus interface for snapper
Loaded: loaded (/usr/lib/systemd/system/snapperd.service; static)
Active: inactive (dead)
Docs: man:snapperd(8)
Jun 23 13:05:21 fedora systemd[1]: Starting DBus interface for snapper...
Jun 23 13:05:21 fedora systemd[1]: Started DBus interface for snapper.
Jun 23 13:06:22 fedora systemd[1]: snapperd.service: Deactivated successfully.
Edit: giving a second look to my snapshots, I do not have the hourly snapshots I should have with TIMELINE_CREATE="yes" either, it’s only pre/post installation. Might that be related?