Jun 08 2009
Posted by Webmasters-central.com as Tutorials
Read this article on how to set up cron.
After setting up, you should know the cron output so you can make sure it is working or not.
You have TWO options.
This can be done by either your hostpanel graphical interface or editing crontab file directly (when your host allowed crontab in your user account).
1. Login into your hostpanel.
2. Set up cron.
3. Look for a textbox in your cron manager area.
4. Enter your email where you want to receive cron output and save. You will receive cron output to this email.
Note: On some hosts if cron running smoothly without any errors, it won’t send email to you. So don’t think cron is not executing. In this case change your cron file name to some wrong file name just to see cron executing. As this is wrong file name that doesn’t exists, cron sends you email saying ‘Output file not specified’.
Edit your crontab file to look like this. Add your email to the top of the file.
MAILTO=”you@email.com”
30 20 * * * /home/user/path/to/php/cronfile.php
30 21 * * * /home/user/path/to/php/another-cronfile.cgi
You can direct cron output to a text file so when executes it writes an output.
You can do this using your cron graphical user interface or adding it to your cron tab file.
Just add text file path to a the cron job there.
30 20 * * * * /home/user/path/to/php/cronfile.php >> /home/myuser/cronlog.log
.
| M | T | W | T | F | S | S |
|---|---|---|---|---|---|---|
| « Aug | ||||||
| 1 | 2 | 3 | 4 | 5 | ||
| 6 | 7 | 8 | 9 | 10 | 11 | 12 |
| 13 | 14 | 15 | 16 | 17 | 18 | 19 |
| 20 | 21 | 22 | 23 | 24 | 25 | 26 |
| 27 | 28 | 29 | 30 | |||
RSS feed for comments on this post · TrackBack URI
Leave a reply