My webserver is running cpanel and has a Cron job module in it providing a GUI to add/remove/edit cron jobs.

Problem: I need to create a large number of cron jobs (more than 100). Each cronjob simply does a wget <url> to trigger a bunch of PHP functions. What will be the best way to manage them? The current problem with cPanel's Cron GUI is that there will be no organization in the cron jobs. If I have 5 related cron jobs, added seperately admist 100 other unrelated cron jobs, it will get harder to find these cron jobs in the long list of cron jobs.

Should I stick to cPanel's GUI? Or is there an alternative GUI with better features like folders or the ability to move cron jobs up and down the list? Or should I just have 1 cron job, which calls a PHP file that does the various wget in PHP using CURL, with a table and stores the jobs in a MySQL database, essentially creating my own version of cron that runs off a single cronjob which triggers every minute?

asked Aug 18, 2012 at 20:57

Nyxynyx's user avatar

NyxynyxNyxynyx

63.1k163 gold badges502 silver badges853 bronze badges

4

Try grouping them.

Say you have 10 groups of ten, depending on how you organise them.

Each one of the cron jobs calls a PHP script that calls 10 other PHP scripts.

If you need them run at different times you could do a simple check with time() to see which scripts should be called.

You could call them the other PHP scripts using cURL.

Make sure to set a large script timeout though, or you might end up with lots of things going wrong.

answered Aug 18, 2012 at 21:01

Alfo's user avatar

AlfoAlfo

4,81910 gold badges39 silver badges51 bronze badges

Could you create one job in CPanel that will run one script.

Then in that script you could create the logic to run the 100 scripts.

If they are to be run at different times then you could use switch(time), or similar to manage execution.

answered Aug 18, 2012 at 21:01

jim's user avatar

jimjim

9,05815 gold badges81 silver badges149 bronze badges