Skip to content

Instantly share code, notes, and snippets.

@Schnouki
Created October 25, 2018 07:31
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 Schnouki/a4864a8b7d2299ad477b599e66b24568 to your computer and use it in GitHub Desktop.
Save Schnouki/a4864a8b7d2299ad477b599e66b24568 to your computer and use it in GitHub Desktop.
Start and stop gitlab-runner with systemd timers
[Unit]
Description=Start gitlab-runner every morning
[Service]
Type=oneshot
ExecStart=/usr/bin/systemctl start gitlab-runner.service
[Unit]
Description=Start gitlab-runner every morning
[Timer]
OnCalendar=Mon..Fri 8:00:00
Persistent=true
[Install]
WantedBy=timers.target
[Unit]
Description=Stop gitlab-runner every evening
[Service]
Type=oneshot
ExecStart=/usr/bin/systemctl stop gitlab-runner.service
[Unit]
Description=Stop gitlab-runner every evening
[Timer]
OnCalendar=Mon..Fri 16:30:00
Persistent=true
[Install]
WantedBy=timers.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment