How to setup a Cronjob in DirectAdmin

Published by: 0

If you want a task to be run at a scheduled interval, then you will need to set a cronjob in your DirectAdmin account.

1) Log into your DirectAdmin account you want to setup your email piping for. How to log into DirectAdmin

2) Locate the Advanced Features then click on Cronjobs

3) You should see the following form to schedule the jobs

Minute: To run at every minute */x, substitute the x for the minute interval. For example; every 15 minutes cronjob would be

*/15 * * * *

To run at a specific miunte, use 0-59. For example if you want to run at 15,30,45 then you would enter 15,30,30 in the minutes field. The whole cronjob would look like

15,30,30 * * * *

Hour: Similar to minutes, to run at regular hour interval. */x

To run at a specific hour; then use 0-23 in the hours field

Day: To run on every day, use

*

To run on every 2 days, use

*/2

To run at a specific day, use 0-30/31 (depending on the month). For example if you want to run at the 1st and the 15th of everything. It would be

1,15

Month: To run every third month

*/3

To run on January and September.

1,9

To run on specific month. Use

1-12

Weekday: Weekday, use

1-5

Weekend, use

6-7

Monday, Thursday, Saturday, use

1,4,6

Run on specific day, use the variable

1-7

4) The follow is an example to run the script located in /home/demodomain/public_html/cronjob.php .

At every 15,45th minute, every 2 hours, on the 10th, 20th and 30th day of the month, every month.

and if you don’t want to receive notification emails when the cronjob is run, click on Prevent Email button. It will append >/dev/null 2>&1 onto your existing Command

Click Add once everything is ok

5) Now you should see the following cronjob under your account