Scheduled jobs tend to linger after the work they did has moved elsewhere. Removing a systemd timer means disabling it and taking its timer file away, because systemctl has no remove command.
Only a timer you created yourself should be removed this way. A timer installed by a package lives under /usr/lib/systemd/system, and a package update can put a deleted file back, so turning it off with disable --now is the lasting answer there.
The service the timer started stays in place and can still be run by hand. Whatever the job has already created is left alone too, so cleaning up after it is a separate decision.
Steps to remove a systemd timer:
- Find the timer's file on the first line of its definition.
$ systemctl cat cache-prune.timer # /etc/systemd/system/cache-prune.timer [Unit] Description=Cache Prune Schedule [Timer] OnCalendar=hourly Persistent=true [Install] WantedBy=timers.target
Do not delete a timer whose path starts with /usr/lib/systemd/system. A package owns that file, so disable the timer instead.
Related: How to manage a systemd timer with systemctlcache-prune.timer is an example name, so use your timer's name in its place.
- Turn the timer off now and for future boots.
$ sudo systemctl disable --now cache-prune.timer Removed '/etc/systemd/system/timers.target.wants/cache-prune.timer'.
- Move the timer file out of the systemd folder.
$ sudo mv /etc/systemd/system/cache-prune.timer /root/cache-prune.timer.bak
The copy in /root lets you restore the timer later, and it can be deleted once you are sure. If you changed the timer with systemctl edit, delete its override too with sudo rm -r /etc/systemd/system/cache-prune.timer.d.
- Reload systemd so it forgets the timer.
$ sudo systemctl daemon-reload
- Check that the timer has gone.
$ systemctl status cache-prune.timer Unit cache-prune.timer could not be found.
If the status still shows the timer, a packaged copy sits underneath the file you moved, so disable that one instead of deleting it.