Interview Prep/Shell Scripting/cron and systemd timers

How do you run a user-level timer, and why does it stop when you log out?

AdvancedConceptcron and systemd timers
Answer

Put units in ~/.config/systemd/user/ and manage them with systemctl --user. The user's systemd instance only runs while the user has a session, so timers stop at logout and do not start at boot, unless lingering is enabled:

systemctl --user daemon-reload
systemctl --user enable --now report.timer
sudo loginctl enable-linger "$USER"
journalctl --user -u report.service

For production server jobs, prefer system units with User=svc-account.

All Shell Scripting questions Roadmap: Shell scripting (Bash)

More on cron and systemd timers