+254725682556 +254725052660 info@ziprof.co.ke
Client Area

DirectAdmin - Control Panel

How to Set Up a Cron Job in DirectAdmin

A cron job runs a task automatically on a schedule, without you needing to trigger it by hand. This is commonly used for scheduled scripts in web applications, automated reports, or routine maintenance tasks.

Creating a Cron Job

  1. Log in to DirectAdmin.
  2. Click Cron Jobs from the main menu.
  3. Set the minute, hour, day, month, and weekday fields for when the job should run, or choose a preset interval if one is offered.
  4. Enter the command to run in the Command field, for example the full path to a PHP script.
  5. Click Create.

Example Schedules

  • Once a day at midnight: minute 0, hour 0, every day, every month, every weekday.
  • Every 30 minutes: use */30 in the minute field.
  • Once a week on Monday at 6am: minute 0, hour 6, every day of month, every month, weekday set to Monday.

What the Command Should Look Like

For a PHP script, the command typically needs the full path to PHP and the full path to your script, for example:

/usr/local/bin/php /home/yourusername/domains/yourdomain.com/public_html/script.php

If you're unsure of the correct PHP path on your server, contact ZIPROF support and we'll confirm it for your account.

DirectAdmin can email you the output of each cron run. If a script produces routine output you don't need, either redirect the output in the command itself or leave the notification email field blank to avoid a cluttered inbox.

DirectAdmin - Control Panel