in reply to Re^2: cron script best practices
in thread cron script best practices
20,35,50,05 * * * * /home/reports/ftp/YTSMSC50/loadData.pl 20,35,50,05 * * * * /home/reports/ftp/FDSMSC/loadData.pl
Do these scripts need to be run simaltaneously? You could immediately reduce the number of connections to your DB if one script ran, executed, exited, and then the other was fired off.
i.e
20,35,50,05 * * * * /home/reports/ftp/YTSMSC50/loadData.pl; /home/repo +rts/ftp/FDSMSC/loadData.pl
I've got to ask - do any of your inserts work at all? As mentioned in another response, if your script is working fine from hand but not from cron, it may be an environment issue. I'd modify my cron to something like
20,35,50,05 * * * * /bin/env > /tmp/env.output; /home/reports/ftp/YTSM +SC50/loadData.pl; /home/reports/ftp/FDSMSC/loadData.pl
and then check the contents of /tmp/env.output and compare them to the output of env when you run it at a command line for any important/potential differences. You could then set these env variables to your perl script.
Some other obvious things would be to make sure that you're disconnecting from the db. And if it's not running properly from cron on a regular basis, then run it only once from cron and debug that and ensure that it does run fine from cron, before filling up your cron with multiple runs each hour.
Finally, why is your /usr filling up on a regular basis as a result of this script?
|
|---|