tags:

views:

1122

answers:

3

I have written a script that gets data from solr for which date is within the specified period, and I run the script using as a daily cron.

The problem is the cronjob does not complete the task. If I manually run the script (for the same time period), it works well. If I reduce the specified time period, the script runs from the cron as well. So my guess is cronjob is timing out while running the script is there is much data to process.

How do I increase the timeout for cronjob?

PS - 1. The script I am running in cronjob is a bash script which runs a python script.

+2  A: 

You could try to use ulimit -t [number of seconds] in the cronjob before running the script.

schnaader
A: 

I'm having this same exact problem.. and here we have no solutions, dangit!

Quasar
A: 

Note that the ulimit -t solution suggested will limit the amount of CPU time used, not the amount of actual time that has passed.

From the bash manpage:

ulimit [-HSTabcdefilmnpqrstuvx [limit]]
...
-t     The maximum amount of cpu time in seconds

And more importantly, cron doesn't impose any timeouts in the first place. It simply kicks off whatever process and moves on.


BTW: Sorry for posting this as an answer, but I don't have enough points to add comments yet.

Lowell