diff --git a/README.md b/README.md index 1c879b2..f64716e 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,42 @@ Recommended crontab usage: (do not forget logrotate) +### Systemd + +Recommended systemd usage: + +```toml +# /etc/systemd/system/dc-ops.service +[Unit] +Description=Run dc-ops once +After=docker.target + +[Service] +Type=simple +WorkingDirectory=/opt/dc-ops/ +ExecStart=python3 dc-ops +``` + +```toml +# /etc/systemd/system/dc-ops.timer +[Unit] +Description=Start dc-ops service periodically + +[Timer] +Persistent=true +OnCalendar=*:0/15 +Unit=dc-ops.service + +[Install] +WantedBy=timers.target +``` + +Enable and start the timer: +``` +systemctl enable dc-ops.timer +systemctl start dc-ops.timer +``` + ## Parameters See `dc-ops --help`