Show pageOld revisionsBacklinksBack to top This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. ====== Timers ====== Create a service <code> [Unit] Description=IPv6 monitoring [Service] User=root ExecStart=/usr/local/bin/test-ip6 [Install] WantedBy=basic.target </code> Create a timer with the same name but suffixed with .timer <code> [Unit] Description=Run test-ip6 every 10 minutes [Timer] OnBootSec=10min OnUnitActiveSec=10min Unit=test.service [Install] WantedBy=timers.target </code> Timer options: * OnBootSec: duration after boot before starting the service * OnUnitActiveSec: duration between two executions * Unit: define unit to use but by default look for the same name .service file * OnCalendar:Control the timer like a cron task * AccuracySec: define execution window * Persistent (Default is false): If true, it will do as anacron and store last execution to be detect if run is needed after inactivity (like when the device is powered off) Enable the timer: <code> systemctl enable --now test.timer </code> cheatsheet/systemdtimer.txt Last modified: 2024/10/14 20:59by 127.0.0.1