612 B
612 B
Systemd
Timers
Basic timer:
my_service.timer
[Unit]
Description=Run $my_service every hour
[Timer]
OnCalendar=hourly
AccuracySec=10min
Persistent=true
Unit=$my_service.service
[Install]
WantedBy=timers.target
my_service.service
[Unit]
Description=Runs some command
After=syslog.target network.target auditd.service
Wants=network-online.target
[Service]
ExecStart=/usr/bin/command -with -arguments
[Install]
WantedBy=multi-user.target
Create an on-the-fly timer (will not survive reboots)
systemd-run --user --on-calendar '*:0/1' /bin/sh -c "date >> ~/log.txt"