Skip to content

Instantly share code, notes, and snippets.

@zealws
Last active July 29, 2016 18:46
Show Gist options
  • Save zealws/fb935ccedec9fbdc98c8407d270ab214 to your computer and use it in GitHub Desktop.
Save zealws/fb935ccedec9fbdc98c8407d270ab214 to your computer and use it in GitHub Desktop.
# cat /root/blah.timer
[Unit]
Description=Run scheduled task blah
After=network.target
[Timer]
OnCalendar=*:0/5:0
AccuracySec=1s
Persistent=false
RandomizedDelaySec=3600s
Unit=blah.service
[Install]
WantedBy=multi-user.target
# cat /root/blah.service
[Unit]
Description=Run scheduled task blah
After=network.target
[Service]
Type=oneshot
ExecStart=/usr/bin/echo 'Hello, world'
TimeoutSec=0s
StandardOutput=null
# sudo systemctl link /root/blah.timer
Created symlink /etc/systemd/system/blah.timer → /root/blah.timer.
# sudo systemctl link /root/blah.service
Created symlink /etc/systemd/system/blah.service → /root/blah.service.
# ls -l /etc/systemd/system/blah.*
lrwxrwxrwx 1 root root 18 Jul 29 11:31 /etc/systemd/system/blah.service -> /root/blah.service
lrwxrwxrwx 1 root root 16 Jul 29 11:31 /etc/systemd/system/blah.timer -> /root/blah.timer
# sudo systemctl enable blah.timer
Failed to enable unit: Too many levels of symbolic links
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment