I have 5-6 jobs to be done by cron, and i have separated php scripts for those jobs.
My question is, which one is better, putting all the jobs in one php script or keeping them in separated php files and entering them to crontab separately ?
thx
I have 5-6 jobs to be done by cron, and i have separated php scripts for those jobs.
My question is, which one is better, putting all the jobs in one php script or keeping them in separated php files and entering them to crontab separately ?
thx
I'd recommend separate scripts. Primarily it will be much easier to debug/diagnose issues when you get a "failed" email from cron if you know which script was running at the time.
It also allows you to run the other jobs even if one fails more easily.
It also gives you flexibilty to change the timings of different jobs (e.g. suppose you suddenly need to run one every 15mins, but all the others are hourly).