
A cron job is for anything you would otherwise repeat by hand at the same time every day or week: taking a copy of the database, deleting temporary files, importing a price list, sending a summary by e-mail. If you already know how to create one, here are seven concrete uses for a small site on shared hosting. To create one, see cron jobs: what they are for and how to create one.
Seven ideas, most useful first
|
|
|
|
|
|
|
How often, and where to see the result
| Job | A reasonable frequency | Where you see it ran |
| Database copy | Once a day, in the small hours. | The new file in the backup folder. |
| Clearing files | Once a day or once a week. | A smaller folder; use >> for a log. |
| WordPress cron | Every five minutes. | A scheduled post that goes out on time. |
| Importing data | When the supplier updates, plus a margin. | The modification date of the file or table. |
| E-mail report | Once a day or once a week. | The e-mail in your inbox. |
| A cron job spends your account’s resources like a visitor does. Do not schedule anything every minute unless you must: if one run takes longer than the interval they start piling up. The reasoning is in cron jobs. |
Keep scripts outside public_html, in a folder such as /home/ACCOUNT/scripts. Nobody can open them from a browser, and they stop depending on the site’s address. Add >> /home/ACCOUNT/cron.log 2>&1 to the end of the line for the first weeks, so you have a record of what happened.
|
|
Want a plan with cPanel and scheduled tasks? See the hosting plans. See the plans |
RECOMMENDED PRODUCT Web hosting with cPanel Domain and SSL included, daily backups and the panel you already know. from ₦9.900,00/mo (3-year plan, with coupon) See plans |
- 0 Users Found This Useful











