Cron jobs allow you to automate tasks such as running scripts or cleaning up files at specific times.
To create a cron job:
-
Log in to cPanel.
-
Go to Advanced → Cron Jobs.
-
In the Add New Cron Job section, choose a common setting like once per day or enter custom timing values.
-
In the Command field, enter the script or command to run, for example:
php -q /home/username/public_html/cron.php -
Click Add New Cron Job.
Your cron job will now run automatically based on your chosen schedule. You can view or delete existing jobs in the same section.
Always test your script manually before automating it to ensure it runs correctly.