Knowledge Base
Creating cron jobs
A cron job runs a command or script on a schedule, for example a WordPress task or a backup.
- Log into DirectAdmin and open Cron Jobs under Advanced Features.
- Choose how often it should run, or set the minute, hour, day, month and weekday fields.
- Enter the command, for example
php /home/username/domains/example.com/public_html/cron.php. - Click Create.
Tips
- Use the full path to the program and the script.
- Run jobs only as often as you need, since frequent jobs use up your resources, see Understanding web hosting resource usage.
- To stop an email being sent for every run, add
> /dev/null 2>&1to the end of the command.
WordPress sites can use a real cron job instead of WP-Cron, which runs when visitors arrive.