Search Our Database

How to set up cron jobs in DirectAdmin

Last updated on |
by

Introduction

This guide will walk you through the process of setting up cron jobs in DirectAdmin. Cron jobs are scheduled tasks that run automatically at specific intervals. They are essential for automating tasks like backups, updating databases, sending emails, and more. This article is intended for users who want to automate regular tasks. By following this guide, you can easily configure cron jobs on your DirectAdmin server.

 

Prerequisites

  • You have DirectAdmin access with either admin or reseller-level credentials.
  • A basic understanding of Linux commands and cron job syntax.
  • A specific script or command that you want to run through the cron job.

 

Step-by-Step Guide

1. Log in to DirectAdmin control panel

Log in to DirectAdmin with admin or reseller-level credentials, click on ‘Cronjobs’ under Advanced Features section.

 

2. Set up a new cron job

In the Cronjobs interface, you will see several input fields to define your cron job schedule and the command you wish to run. Enter the following details:

Minute: Specify at what minute the cron job should run (0-59).
Hour: Specify the hour (0-23).
Day of Month: Specify the day of the month (1-31).
Month: Specify the month (1-12).
Day of the Week: Specify the day of the week (0-7, where both 0 and 7 refer to Sunday).
Command: Enter the full path of the script or command you want to run.

Upload your cron job script to a specific directory in your hosting space using an FTP client. Once uploaded, enter the full path of the script you uploaded in the Command field. Please ensure that the script has the correct permissions (e.g., executable permissions) to be run by the cron job.

After filling out the fields, click on ‘Add’ to create the cron job.

 

3. Verify the cron job creation

Your new cron job will now appear in the list of cron jobs and will run according to the schedule you have specified.

 

Edit or remove a cron job

To edit an en existing cron job, find it in the list and tick the checkbox, then click on ‘Edit’. Make the necessary changes and click ‘Save’. To delete a cron job, simply click on ‘Delete‘ to the entry you want to remove.

 

Conclusion

Setting up cron jobs in DirectAdmin is an efficient way to automate routine tasks. With this guide, you can create, edit, or remove cron jobs as needed to ensure your server tasks are running automatically.

 

 

Article posted on 14 April 2020 by Louis.