I have three scripts running under crontab and theyre executing perfectly (see the log below):

Oct  9 10:40:01 servercharlie CRON[29850]: (root) CMD (php -q /var/www/folder/script-3.php)
Oct  9 10:41:01 servercharlie CRON[29861]: (root) CMD (php -q /var/www/tasks/script-1.php)
Oct  9 10:42:01 servercharlie CRON[29867]: (root) CMD (php -q /var/www/tasks/script-1.php)
Oct  9 10:43:01 servercharlie CRON[29873]: (root) CMD (php -q /var/www/tasks/script-1.php)
Oct  9 10:44:01 servercharlie CRON[29879]: (root) CMD (php -q /var/www/tasks/script-1.php)
Oct  9 10:45:01 servercharlie CRON[29887]: (root) CMD (   php -q /var/www/script-2.php)
Oct  9 10:45:01 servercharlie CRON[29888]: (root) CMD (php -q /var/www/tasks/script-1.php)
Oct  9 10:45:01 servercharlie CRON[29889]: (root) CMD (php -q /var/www/folder/script-3.php)
Oct  9 10:46:01 servercharlie CRON[29901]: (root) CMD (php -q /var/www/tasks/script-1.php)
Oct  9 10:47:01 servercharlie CRON[29907]: (root) CMD (php -q /var/www/tasks/script-1.php)
Oct  9 10:48:01 servercharlie CRON[29915]: (root) CMD (php -q /var/www/tasks/script-1.php)
Oct  9 10:49:01 servercharlie CRON[29921]: (root) CMD (php -q /var/www/tasks/script-1.php)
Oct  9 10:50:01 servercharlie CRON[29929]: (root) CMD (php -q /var/www/tasks/script-1.php)
Oct  9 10:50:01 servercharlie CRON[29930]: (root) CMD (php -q /var/www/folder/script-3.php)
Oct  9 10:50:01 servercharlie CRON[29931]: (root) CMD (   php -q /var/www/script-2.php)
Oct  9 10:51:01 servercharlie CRON[29942]: (root) CMD (php -q /var/www/tasks/script-1.php)
Oct  9 10:52:01 servercharlie CRON[29949]: (root) CMD (php -q /var/www/tasks/script-1.php)
Oct  9 10:53:01 servercharlie CRON[29958]: (root) CMD (php -q /var/www/tasks/script-1.php)

Script 1 runs every minute and executes flawlessly. Script 2 executes every 5 minutes and this is the one I'm having problems with. It never completes its execution. It's a 10 - 15 minute long script. I have set_time_limit(0); in the file at the top, I have changed all limits on execution in php.ini to 0.

What else can be killing the execution of the script? At the moment it's working fine for half of the profiles on my website - but never reaches the last half...

Thanks in advance for any guidance!

Recommended Answers

All 7 Replies

There's nothing wrong with the script as it works great if I execute it in my browser. This has to be a setting that I don't know about somewhere

Well, if you run a script every 5 minutes, that takes 10-15 minutes to complete... every new script will slow down all others, incrementally.

commented: haha! i get so wrapped in code I forget basic maths, of course! +1

Ofcourse but putting that aside - none of them are passing the 10 min marker... they should still complete their execution.

I think the only way to find out is to add some logging, so the script's actions become traceable.

That sounds like a good idea, any ideas how to log a scripts actions on Ubuntu 10.04 LTS?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.