Using systemd Timer
If your system does not use systemd timers, you may also use a cron job instead.
What is systemd?
systemd is the standard service manager used by most modern Linux distributions.
A systemd timer is used to schedule tasks in a similar way to a cron job. Timers can run commands based on specific times, dates, or intervals.
Watch My Domains SED uses a timer to periodically execute the cron.php
script which processes the lookup queue and performs scheduled checks.
Using systemd Instead of Cron
To run the scheduled job using systemd, create two files:
- A service unit which defines the command to run
- A timer unit which defines when the command should run
Please adjust the paths in the examples below to match your installation.
Service File
Create the following file:
/etc/systemd/system/wmdsed.service
[Unit] Description=Watch My Domains SED Cron Task [Service] Type=oneshot ExecStart=php /var/www/html/wmdsed60/cron.php WorkingDirectory=/var/www/html/wmdsed60/
Timer File
Create the following file:
/etc/systemd/system/wmdsed.timer
[Unit] Description=Watch My Domains SED Timer [Timer] OnCalendar=*-*-* *:*:00 Persistent=true [Install] WantedBy=timers.target
Enable and Start the Timer
After creating the files, reload systemd and enable the timer.
sudo systemctl daemon-reload sudo systemctl enable wmdsed.timer sudo systemctl start wmdsed.timer
Verify the Timer
You can confirm that the timer is active using:
systemctl status wmdsed.timer
To list all active timers:
systemctl list-timers
The timer runs the task once every minute, which is the recommended schedule for processing the lookup queue.