For the last two years Snapper has been working flawlessly to perform hourly snapshots (on the hour). A few days ago I noticed two snapshots are being taken every hour. One on the hour (HH:00), and the other at 1 minute after the hour (HH:01)
The snapper log file shows the same process ID for libsnapper for both of theses duplicate snapshots. Each hour there is a new process ID, but the duplicate snapshots are performed by the same process ID according to the logs. In the logs things look normal. The job is simply repeated twice, from what I can see.
snapper list-configs
does not have any duplicate configs.
I had always had a systemd timer enabled and started for snapper-timeline.timer (which was set up in accord with Arch's wiki page for Snapper).
I have no root cron:
# crontab -l
no crontab for root
As far as I know, there is no cron for any user: /var/spool/cron/
is empty.
Here's the really strange thing. After stopping and disabling snapper-timeline.timer
, the snapshots on the hour stop, but the snapshots 1 minute after the hour continue. This is true even after a reboot.
After the step above, there are no snapper-timeline.timer entries listed by systemctl:
$ systemctl --user list-timers
0 timers listed.
$ sudo systemctl list-timers
NEXT LEFT LAST PASSED UNIT ACTIVATES
Wed 2018-02-21 00:00:00 EST 1h 40min left Tue 2018-02-20 00:00:00 EST 22h ago logrotate.timer logrotate.service
Wed 2018-02-21 00:00:00 EST 1h 40min left Tue 2018-02-20 00:00:00 EST 22h ago man-db.timer man-db.service
Wed 2018-02-21 00:00:00 EST 1h 40min left Tue 2018-02-20 00:00:00 EST 22h ago shadow.timer shadow.service
Wed 2018-02-21 03:54:50 EST 5h 35min left Tue 2018-02-20 03:54:49 EST 18h ago snapper-cleanup.timer snapper-cleanup.service
Wed 2018-02-21 03:59:50 EST 5h 40min left Tue 2018-02-20 03:59:49 EST 18h ago systemd-tmpfiles-clean.timer systemd-tmpfiles-clean.service
Mon 2018-02-26 00:00:00 EST 5 days left Mon 2018-02-19 00:00:23 EST 1 day 22h ago fstrim.timer fstrim.service
Update:
As we know from the Arch Wiki Snapper page, under "Automatic timeline snapshots":
If you have a cron daemon, this feature [automatic hourly snapshots] should start automatically.
As I said above, I checked crontab -l
as root and as my user and both were empty.
However, in my case I do have cronie installed (cronie is a cron daemon). Looking in /etc/cron.daily/
showed a snapper file and /etc/cron.hourly/
also contains a snapper file.
The remaining questions are:
which user's crontab would show the Snapper cronjob?
is there a way to make Snapper's cronjob inactive that will persist across package updates (while keeping the systemd timer active)? I assume that if I simply delete the entries in
/etc/cron.daily
and /etc/cron.hourly/` they will get replaced when the Snapper package is updated. [UPDATE 2: I did a test that confirms this assumption. See comments.]
systemctl list-timers && systemctl --user list-timers
.systemctl list-unit-files --state=enabled
.