Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

My crontab is crashing when I run a script that inserts a lot of lines on MySQL Database, but when I run a script that inserts a few lines it runs properly. Is there some configuration file of cron? Maybe some config about use of memory.

share|improve this question
add comment

2 Answers

You need to find the reason of the script crashing. Here are some points to check:

  1. Make sure you don't have multiple running instances of the same script. This is especially useful if you are running the script for a long time and/or too frequently.
  2. Include some debug information in the script whenever relevant. This helps you determines where the script got stopped.
  3. Split the insert statements into multiple iterations if possible.
share|improve this answer
    
i fixed it, it was mysql memory usage. I installed a newest version and it get fixed. I was using a older MySQL Version –  Mr2ks Jan 30 '12 at 12:12
add comment

Using a cron job to insert "don't know how many" rows into MySQL is bad design.

First of all determine if the cron jobs get enough time to finish the insert, by proper logging outside of the normal cron process.

Then, when you have determined that yes, it does take too much time, reduce the frequency of the cron job, or reduce the number of inserts during one run.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.