Skip to content

Instantly share code, notes, and snippets.

View spacecowboy's full-sized avatar

Jonas Kalderstam spacecowboy

View GitHub Profile
@spacecowboy
spacecowboy / README.md
Last active February 26, 2024 08:59
Systemd timer to restart systemd services on a schedule

First copy the files

Place the .timer and .service file in the /etc/systemd/system/ folder.

How to use

To use, let's assume I want to restart nginx every night. Then I'd do:

systemctl enable --now restart_nightly@nginx.timer