Script taking more time in CRONTAB


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Script taking more time in CRONTAB
# 1  
Old 01-16-2013
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
# 2  
Old 01-16-2013
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. Smilie
# 3  
Old 01-16-2013
What operating system and version?
# 4  
Old 01-16-2013
Hi fpmurphy,

The OS & Version:

HTML Code:
SunOS dcr1a 5.10 Generic_144489-06 i86pc i386 i86pc
Quote:
There is one condition that the script is using an input file of 500mb, does this effect the script processing in crontab, If yes then how can i resolve it
# 5  
Old 01-16-2013
Does the script use the same 500MB file both when you run manually as well as from the cron?
# 6  
Old 01-16-2013
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 ??
# 7  
Old 01-16-2013
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
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Red Hat

Script taking more time to send report to mail

Hi, I schedule a script on linux server and it is taking more time say "30 minutes" to send the report via mail. Could you please suggest a way to speed up sending report to mail? OS version -- Red Hat Enterprise Linux Server release 6.5 (Santiago) Regards, Maddy (2 Replies)
Discussion started by: Maddy123
2 Replies

2. UNIX for Advanced & Expert Users

Script only runs first time through crontab

Hello, I am trying to run a script through crontab and it runs the first time and then it does not run. I tried to run a simple script (as shown below) and I see the same issue. #!/bin/ksh clear echo "Good Morning, World." > /tmp/test123 Crontab Entry: 30 09 * * *... (9 Replies)
Discussion started by: hasn318
9 Replies

3. UNIX for Dummies Questions & Answers

ls is taking long time to list

Hi, All the data are kept on Netapp using NFS. some directories are so fast when doing ls but few of them are slow. After doing few times, it becomes fast. Then again after few minutes, it becomes slow again. Can you advise what's going on? This one directory I am very interested is giving... (3 Replies)
Discussion started by: samnyc
3 Replies

4. Shell Programming and Scripting

Crontab - wrote Simple Script but i cant work out how to play it at a certain time.

Hi everyone. Silly might be silly be I'm still new to bash. I'm trying to make an Alarm Clock for in the morning using my laptop i have wrote this Simple Script but i cant work out how to play it at a certain time. #!/bin/bash cd /home/josh/Music/Bruno_Mars/Hooligans/ cvlc... (8 Replies)
Discussion started by: jtsmith90
8 Replies

5. Shell Programming and Scripting

Taking one input at a time

Legends, Please help me to come out of the below Bermuda triangle. I have four inputs in a shell script: A B C D Now, If A is passed by user then, B C D will be ignored. If C is passed by user, then A B D will be ignored. Regards, Sandy (11 Replies)
Discussion started by: sdosanjh
11 Replies

6. UNIX for Dummies Questions & Answers

SED taking too much time

Hi I am trying to remove some characters from my data file. The data file has huge number of records say 90000 records. I am using sed for this purpose. eg : cat FILENAME|sed 's/;//g' (to remove semi colon ';') However as the data file is too huge , it is taking too much time to give... (3 Replies)
Discussion started by: dashing201
3 Replies

7. UNIX for Dummies Questions & Answers

Job is taking long time

Hi , We have 20 jobs are scheduled. In that one of our job is taking long time ,it's not completing. If we are not terminating it's running infinity time actually the job completion time is 5 minutes. The job is deleting some records from the table and two insert statements and one select... (7 Replies)
Discussion started by: ajaykumarkona
7 Replies

8. Shell Programming and Scripting

<AIX>Problem in purge script, taking very very long time to complete 18.30hrs

Hi, I have here a script which is used to purge older files/directories based on defined purge period. The script consists of 45 find commands, where each command will need to traverse through more than a million directories. Therefore a single find command executes around 22-25 mins... (7 Replies)
Discussion started by: sravicha
7 Replies

9. Shell Programming and Scripting

Execute via crontab taking username/password from file

Dear All Here is the details what i want to achieve from shell scripts I have a sever where 5 databases are created. which i having diffrent SID's. Now i want to execute some SQL queries on each one of the databases. (SQL Query is same).That i want to acheive via crontab Now each one of the... (2 Replies)
Discussion started by: jhon
2 Replies

10. UNIX for Advanced & Expert Users

Truss taking time in stopping

Hi Experts, I am starting my unix servers with truss cmd and taking truss output in a file . But when I run it for considerabely long time, it is not stopping easily on doing ^C ..... It is taking lotz of ctrl-C's to stop. Please let me know is there any other way to stop truss except ^C and... (1 Reply)
Discussion started by: aarora_98
1 Replies
Login or Register to Ask a Question