In this tutorial, you will learn how to set up or enable Cron jobs in cPanel step by step.
When you try to run any script or anything which you dont want to run manually then you can set up cron jobs. But if you dont know how to enable or set up cron jobs then you should learn it first, Cron jobs allow you to automate certain commands or scripts on your site. You can set a command or script to run at a specific time every day, week, etc. For example, you could set a cron job to delete temporary files every week to free up disk space.
How to Setup and Manage Cron Jobs in cPanel
1) Log into cPanel then click the Cron Jobs icon
2) Cron Email – You can have cron(s) send an email every time it runs a command which produces output.
Send an email with the output every time the cron job runs.
You can have cron send an email every time it runs a command which produces output. If you do not want an email to be sent for an individual cron job, you can redirect the command’s output to /dev/null. For example:
mycommand >/dev/null 2>&1
Note: If you do not wish to receive an email notification of a specific cron job, add the following
line to the command: >/dev/null 2>&1
3) Add New Cron Job – Now you have to define exactly when and how often you want the cron job to run.
4) Next, enter the command of the script you want to run, including the path.
mysqldump -u root -pPASSWORD database > /root/db.sql
/usr/bin/wget --spider "http://www.domain.com/cron.php"
5) When you’re done, click Add New Cron Job button.