Skip to content

Instantly share code, notes, and snippets.

@FUT
Created March 20, 2017 09:47
Show Gist options
  • Save FUT/0c5a516b6f89d8c8ff4b189147374879 to your computer and use it in GitHub Desktop.
Save FUT/0c5a516b6f89d8c8ff4b189147374879 to your computer and use it in GitHub Desktop.
SystemD timers
sudo systemctl daemon-reload
sudo systemctl enable exporter.timer
sudo systemctl status exporter.timer
sudo systemctl list-timers --all
sudo systemctl list-timers
sudo systemctl start exporter.service
sudo systemctl start exporter.timer
[Unit]
Description=Business contacts exporter
[Service]
WorkingDirectory=/var/www/app/backend
ExecStart=/usr/bin/docker-compose up exporter
[Unit]
Description=Run exporter on daily basis
Requires=exporter.service
[Timer]
OnCalendar=*-*-* 13:00:00
Persistent=true
Unit=exporter.service
[Install]
WantedBy=timers.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment