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. 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 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 user name 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. Editing makes not should the correct automatic tools, therefore it may be simpler to copy the Command, remove the cron job, and recreate this.
What do you set to 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