Skip to content

Instantly share code, notes, and snippets.

@sgf-dma
Last active May 24, 2023 08:31
Show Gist options
  • Save sgf-dma/252e7e16dde61263f73cb67a38fb0c68 to your computer and use it in GitHub Desktop.
Save sgf-dma/252e7e16dde61263f73cb67a38fb0c68 to your computer and use it in GitHub Desktop.
# cat /etc/systemd/system/test.timer
[Timer]
OnCalendar=
OnCalendar=*-*-* *:*:00
RandomizedDelaySec=0
Unit=test.target
[Install]
Also=test.target
# cat /etc/systemd/system/test.target
[Unit]
Description=Test target
StopWhenUnneeded=true
[email protected] [email protected]
[email protected] [email protected]
[Install]
[email protected] [email protected]
# cat /etc/systemd/system/[email protected]
[Service]
Type=oneshot
ExecStart=/bin/sh -c 'v="$(shuf -i 4-15 -n1)"; echo Running service %i in $v seconds at $(date) >> /root/1.tmp; sleep $v'
[Install]
#WantedBy=test.target
#RequiredBy=test.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment