Last active
May 24, 2023 08:31
-
-
Save sgf-dma/252e7e16dde61263f73cb67a38fb0c68 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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