DEV Community

Gurpinder Singh
Gurpinder Singh

Posted on

Set cron job in cpanel

Setting up a cron job in cPanel is relatively straightforward. Here's a step-by-step guide:

How to set a cron job by using the terminal in Ubuntu Server

Log in to cPanel:
Go to your cPanel dashboard. You should have received login credentials from your hosting provider.

Locate the Cron Jobs Icon:
In cPanel, search for the "Cron Jobs" icon. It's usually located in the "Advanced" or "Metrics" section, depending on your cPanel theme.

Access the Cron Jobs Page:
Click on the "Cron Jobs" icon to access the Cron Jobs page.

Choose Cron Job Settings:
On the Cron Jobs page, you'll see options to set up cron jobs. You can select from common settings like "Common Settings," "Minute," "Hour," "Day," "Month," and "Weekday."

Enter the Command:
In the "Command" field, enter the command you want the cron job to execute. This could be a PHP script, a shell script, or any other executable command. Make sure the command is correct and complete.

Set the Schedule:
Choose the schedule for your cron job using the "Common Settings" or specify the exact timing using the "Minute," "Hour," "Day," "Month," and "Weekday" fields.

Save the Cron Job:
Once you've entered the command and set the schedule, click on the "Add New Cron Job" or "Add Cron Job" button to save your cron job.

Verify the Cron Job:
After saving, you should see a confirmation message indicating that the cron job has been added successfully. You may also see a list of existing cron jobs on the Cron Jobs page.

Test the Cron Job:
It's a good practice to test your cron job to ensure it's working as expected. You can do this by running the command manually or waiting for the scheduled time to see if it executes.

Monitor and Manage Cron Jobs:
You can monitor and manage your cron jobs from the Cron Jobs page in cPanel. Here, you can edit, delete, or disable cron jobs as needed.

How to send a token with every request using HTTP headers?

Which encryption is used to secure the token key?

How to set a cron job by using the terminal in Ubuntu Server

That's it! You've successfully set up a cron job in cPanel. Make sure to regularly review and update your cron jobs as necessary.

Thanks for reading,
Dgi Host.com

Top comments (0)