Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
We have an issue and need some expert advise. In one of the linux servers, we are running some cron jobs. This cron job loads flat files in to a table in a oracle database using a shell script. This was working fine. Recently we did an upgrade to kernel version and after that it loads the data half way and stops the cron job. (e.g. if there are 100 files, it loads about 13 files and stops). No error anywhere. Assuming that error is due to the kernerl issue we reversed the patch also. But still the problem is still there.
When you execute the file upload shell script manually then it works fine.
This is the OS details of the server
OS name: Red Hat Enterprise Linux ES release 4 (Nahant Update 6)
Kernel version: kernel-smp-2.6.9-89.0.23.EL
Current Kernel version: Linux CCOLDWHZDBOP01 2.6.9-89.0.23.ELsmp #1 SMP Fri Mar 5 17:56:21 EST 2010 i686 i686 i386 GNU/Linux
If a cron job works fine manually, but not from cron, its usually because the path and environment variables are different when run by cron. Example, if a script uses tar, and tar is in your normal users path, then the script will work fine when run manually by that user. If tar is not in crons path, cron will not find tar and the script will fail when run automatically by cron. The update might have changed the way cron handles it's path and env variables. Something to investigate.
If the script you use only has one command, then this cron/path/env would probably not be the issue since it obviously found the command for at least 13 rows. If your script is long, and it inserts records at different places in the script, then the script is probably using some command not found in crons path.
Its not that cron does not run at all. It uploads few files from the list and then stops. No errors on any logs. As i have mentioned above if i submit 100 files it uploads few like 13 - 15. When you run the same scrip in command prompt it uploads all 100 files.
So it cant be an environment variable since it's able to execute half way isn't it ?
Also text files use for the upload are almost similar. We even changed the files and tried but still it could upload only few when executing though the cron.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.