Skip to content

Instantly share code, notes, and snippets.

@beddari
Created June 8, 2017 13:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save beddari/604566367b3e05a909fcbfd16f316f58 to your computer and use it in GitHub Desktop.
Save beddari/604566367b3e05a909fcbfd16f316f58 to your computer and use it in GitHub Desktop.
systemd timers

For the timer:

[Unit]
Description=Do something daily

[Timer]
OnCalendar=daily
Persistent=true

[Install]
WantedBy=timer.target

For the one-shot service:

[Unit]
Description=Restart service

[Service]
Type=oneshot
ExecStart=/usr/bin/systemctl try-restart my_program.service
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment