xf.is blog

Configuring systemd user timer

Published in linux.

To run systemd timer jobs (cron) as a user you’ll need to create a systemd service folder as the user:

mkdir -p ~/.config/systemd/user/

By default, systemd will only run timers if the user is logged in so to be able to run timer jobs without logged in use we enable lingering session with

loginctl enable-linger username

Then you can drop the .service and .timer files in the ~/.config/systemd/user folder.

To pick up the job you’ll need to run (as the user)

systemctl --user daemon-reload

and then you can enable the timer with

systemctl --user enable important.timer --now

and view the result with

systemctl --user list-timers
or
systemctl --user status <service>