A cron job runs a command or script automatically on a schedule. It is useful for tasks like sending reports, clearing caches, or triggering WordPress scheduled events reliably. Here is how to create one in DirectAdmin.
Voordat je begint #
- Know the exact command or script path you want to run.
- Decide how often it should run.
Step-by-step: create a cron job #
- Log in op DirectAdmin (meestal jouwdomein.com:2222).
- Ga naar Geavanceerde functies en klik op Cron Jobs.
- Set the schedule using the minute, hour, day, month, and weekday fields.
- Enter the command to run in the command field.
- Klik op Toevoegen.
Uitleg over de velden in het rooster #
- Notulen: 0 to 59.
- Uur: 0 to 23.
- Day of month: 1 to 31.
- Maand: 1 to 12.
- Day of week: 0 to 6 (0 is Sunday).
- An asterisk (*) means “every”.
Voorbeeld: 0 3 * * * runs a task every day at 3:00 AM.
Common WordPress example #
To run WordPress cron reliably, you can call wp-cron on a schedule, for example every 15 minutes, using a command your developer or our support team can provide for your setup.
Tips #
- Plan zware taken niet te vaak in.
- Send output to a log file so you can check results.
- Test the command manually first if possible.
Problemen oplossen #
- Taak wordt niet uitgevoerd: Controleer het pad naar het commando en het schema nogmaals.
- Te veel e-mails: redirect output to a log instead of email.
- Permission errors: confirm the script is executable.
Hulp nodig? #
Cron syntax can be confusing. Contact our support team on live chat and we will help you set the correct schedule.