Script taking more time in CRONTAB

Hello All,

I have created a shell script, When i run it manually as ./<script_name> it takes 5 hours to run, but when i am scheduling it in crontab, it is taking 20 hours to run.

Please help me and advice, what can be done to reduce the time in crontab.
Thank you

I don't think the run time would differ because of the execution point either u run manually or from crontab it would take the same amount of time to complete if it processing the same amount of data.

Hope this helps. :slight_smile:

What operating system and version?

Hi fpmurphy,

The OS & Version:

SunOS dcr1a 5.10 Generic_144489-06 i86pc i386 i86pc 

Does the script use the same 500MB file both when you run manually as well as from the cron?

Yes, it is taking this file on manual as well as in crontab.
I am also confused why this is happening
Is this something related to some virtual memory ??

When is the job scheduled?
When you run interactively, that means you are in the office no? We are talking of day time... normally all sites have very few batch jobs running daytime in order to not interfere with offices work, ah but when comes evening there should be very few interactive sessions etc... and so it is a good time to launch all the batches, cloase the RDBMS and open them again, then perhaps do an export of the DB etc... and for the system guys its time to do some maintenance...
and most important thing running after hours?
Backups...
That said, how does a unix proize jobs running? well with time jobs that take time (too much...) loose priority as time passes it cant end in a silly situation where the job has so little priority it can almost never finish... ( this was true before Y2K, I cant recall of cases since...)

You have enough clues now to do some investigations!
Good luck