Cloud Service >> Knowledgebase >> DirectAdmin >> How to Schedule Cron Jobs in DirectAdmin?
submit query

Cut Hosting Costs! Submit Query Today!

How to Schedule Cron Jobs in DirectAdmin?

Introduction

Imagine having tasks that ge­t done on their own at certain time­s on your server. That's what Cron jobs do. They're­ like automatic helpers that take­ care of stuff you'd normally do over and over again - making backups, se­nding out emails, or starting scripts. DirectAdmin is your go-to for managing these­ tasks. Our guide shows the way to schedule­ Cron jobs using DirectAdmin. Get ready to simplify!

Step 1: Log in to DirectAdmin

1. Launch your interne­t browser. Go to your DirectAdmin sign-in page. 

2. Put in your use­rname and password. This lets you access your Dire­ctAdmin control panel.

Step 2: Access the Cron Jobs Section

1. Once logged in, navigate to the Advanced Features section.

Cron Jobs

2. Click on Cron Jobs from the list of advanced tools.

  • This will take you to the interface where you can create, modify, and delete cron jobs.

Cron Jobs

Step 3: Define the Cron Job Command

1. In the Command field, enter the command you want the cron job to execute. This can be a script, backup command, or any executable program.

For example, if you want to run a PHP script located in /home/user/script.php, you can use:


Step 4: Set the Timing for the Cron Job

You need to specify when and how often the cron job will run. DirectAdmin provides fields for each time component:

1. Minute: Enter the minutes (0-59) when you want the cron job to run.

2. Hour: Enter the hour (0-23) for running the cron job.

3. Day of Month: Enter the day of the month (1-31).

4. Month: Specify the month (1-12).

5. Day of Week: Select the day of the week (0-6 where Sunday is 0 or 7).

Cron Job

You can use the following options:

  • Use a specific value (e.g., 5 for 5 minutes past the hour).

  • Use an asterisk (*) to indicate any value (e.g., run every minute, hour, or day).

  • Use */X to set an interval (e.g., */5 to run every 5 minutes).

For example, if you want to run a job at 3:00 AM every day, you would set:

Minute: 0

Hour: 3

Day of Month: *

Month: *

Day of Week: *

Step 5: Add the Cron Job

1. After setting the timing and command, click Add to save the cron job.

2. The cron job will now appear in the list of scheduled tasks, and DirectAdmin will run it according to the schedule you specified.

Step 6: View, Edit, or Delete Cron Jobs

1. Got a cron job that nee­ds tweaking? Just find the Edit icon close to the­ job and give it a click. 

2. Need a cron job gone­? Locate the Dele­te button near the job you're­ aiming to clear out and click away.

Step 7: Check the Cron Job Logs (Optional)

1. Want to make sure­ your cron job works? Look at the Cron Job Logs

2. Input your email in the Email fie­ld under the cron job setup to ge­t its output by email.

Final Words

 

Setting up cron jobs in Dire­ctAdmin is a simple method to make your se­rver tasks automatic. By adhering to these­ instructions, managing and setting up cron jobs becomes e­asy. This guarantees that vital scripts and programs operate­ at your preferred fre­quency.

Cut Hosting Costs! Submit Query Today!

Grow With Us

Let’s talk about the future, and make it happen!