What is Cron job?
A Cron does a benefit that provides jobs to automatically work within this environment of the operation at normal periods by application of the Cron. Crontab exists a record which includes each record from Cron notes to be run and toward whatever circumstances men are to be run. A Cron job is a concept developed and used in Linux shared web hosting and If you want to add similar to this in windows shared hosting, then you have to check for the scheduled task in windows.
The Cron job lets you to with spread a particular command at times set on the job. As an example, Y'all could set a Cron job to erase temporary data each week so that your disc space is un-being applied up with those data. To access the Cron Jobs tool, click on the similar icon placed in the Advanced section on the main screen of your Cpanel interface.
How to use Cron job in Linux/Unix?
To create a Cron job, follow the steps below:
1. Click on the “Cron Jobs” icon inside cPanel, under Advanced. (Check your shared hosting username and password in your welcome email)
2. Make sure the current email address is valid. If not, enter a new email and click the “Update Email” button.
3. Choose the Standard Setting you require. That command automatically converts each separate time frames.
4. Alternatively, you may connect the unique time settings. Minute, Hour, Day, Month and Weekday can be adjusted to obtain your objectives.
5. In the input box to the right of “Command”, type the name of the file type, then add a space and provide the path to the file which you would like the command to run.
6. Click the “Add New Cron Job” button.
You have just built a Cron job to perform a file at a specific time and date with the desired repetition.
To update or to delete a Cron job, comprehend the steps below:
1. Click on the “Cron Jobs” icon inside cPanel.
2. Scroll down to the last part called “Current Cron Jobs”.
3. Find the right Cron job and click both “Edit” or “Delete”, under Actions.
4. Edit and make the correct automatic tools, therefore it may be simpler to copy the Command, remove the Cron job, and recreate this.
What do you set on the Cron job Command?
Bold sections must be replaced-
Command to run a PHP5 cron job:
Optional flag sometimes required for a PHP cron job:
php -q /home/username/public_html/cron.php
Command to run a PHP4 cron job:
Command to GET a remote file:/usr/bin/GET http://www.your-domain.com/file.php