exec unable to run via cronjob


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users exec unable to run via cronjob
# 1  
Old 07-11-2007
exec unable to run via cronjob

Hi , I write a script like this\ and put it under / (root) :

Code:
ref=88

df -k | grep /cbmdata/00/gdd | tr -d '%' | \

while read a b c d e other
do

 if (( $e >= $ref )) 
 then
 line=`find /cbmdata/00/gdd -name "LOGS*" |sort -nr |tail -1`
    # echo $line
    rm -f $line
 fi

done

and my crontab input file is:

* 0-12 * * * /del_big_log.sh 2>/del_log.log

I wanted it run two times a day, but I got the error :
/del_big_log.sh: 44: not found

is there any idea ?

thanks
# 2  
Old 07-11-2007
Xramm,
When you run a job under 'cron', the profile is not executed.
Try to specify the full path of 'del_big_log.sh'.
# 3  
Old 07-11-2007
hi shelllife,

yes i put it under root , I mean it is already under
/del_big_log.sh

it is full path Smilie
# 4  
Old 07-11-2007
The full path is the entire directory structure where 'del_big_log.sh'
is located -- example:
/home/abc/my_shells/del_big_log.sh
# 5  
Old 07-11-2007
Xramm,
You can also check the line 44 on 'del_big_log.sh'.
# 6  
Old 07-11-2007
my script is under root, i mean under /
you say I have to put it other directory rather than root ?

it is only 15 lines, 44 must be something other than lines

thanks
# 7  
Old 07-11-2007
Xramm,
I am logged into my system right now, thus I cannot assure you
what the problem is, but try the following two things:
1) Remove the empty line between the 'df' and the 'while':
Code:
df -k | grep /cbmdata/00/gdd | tr -d '%' | \
while read a b c d e other
do

2) Run 'del_big_log.sh' yourself under the unix prompt to see if it works.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Seeing unexpected results when i run through cronjob

Hi I'm having hard time here with below script. If i run script manually i see expected results but, if i keep this script in cron job i'm getting unexpected results. Unexpected results means even though condition is true,cronjob returning output of else condition. This script and cronjob... (2 Replies)
Discussion started by: buzzme
2 Replies

2. Shell Programming and Scripting

Unable to execute glance from cronjob

Hi I am writing a script to get the CPU and memory utilization periodically from glance command. Wrote a script which consists of below two lines Script name : Utilization.sh #!/bin/sh glance -iterations 1 | sed -n '/Util/p/'| awk '!/Disk/'| awk '!/Swap/' >> file.txt I am able to run the... (5 Replies)
Discussion started by: Shravani
5 Replies

3. Shell Programming and Scripting

Run cronjob for every 10 minutes

Hi Friends, I have a requirement to run the cronjob for every 10 minutes from 2:00 AM to 6:00 AM. Does the below code works? If not, please advise. * * * * * command to be executed ┬ ┬ ┬ ┬ ┬ │ │ │ │ │ │ │ │ │ │ │ │ │ │ └---------------------------------- day of week (0 - 6) (0 is... (5 Replies)
Discussion started by: srikanthbiradar
5 Replies

4. Shell Programming and Scripting

How to accomplished to run zenity in cronjob?

Hi, I would like to ask some few questions about zenity. I write a script that would generate a report if any changes on the files. i want to used zenity to had a visual alarm report if theres some changes on the comparisons of the file.I used this line of zenity but it doesn't work in cronjob.... (5 Replies)
Discussion started by: jao_madn
5 Replies

5. UNIX for Dummies Questions & Answers

Run a cronjob only when a file is modified?

Hello, I am new to cron. I have a cronjob that updates a dataset in a 3rd party application. The contents of this dataset come from a text file, which is updated irregularly. Currently my cronjob runs once every week, to update this dataset (irrespective of whether the file was updated or not).... (7 Replies)
Discussion started by: ad23
7 Replies

6. Shell Programming and Scripting

Error at the time of cronjob run

Hi All , Please read the below data carefully. I have run the below script on unix server its running succesfully. but when i run the same script using cronsetyp it giving me the error : command not found at (line num):cruiseStartup.sh below is code netstat -anp |grep 8181... (5 Replies)
Discussion started by: aish11
5 Replies

7. AIX

My script didn't run every run every minute at cronjob

In my cronjob, I would like to schedule my script.sh to run every minutes. I crontab -e and have in line below but it didn't seems to run at all. * * * * * script.sh When I run it manually, I can run it. Is that anything wrong with the above line? If I change it to something like below,... (4 Replies)
Discussion started by: ngaisteve1
4 Replies

8. Shell Programming and Scripting

Doesn't run as a cronjob...

Hi! I have a svn backup script that works perfectly if I execute it from the command line but if I set it as a cronjob to run at night, only part of the code works. So, basically the scripts starts by deleting the folder yesterday and then moves the folder today to the folder yesterday. When... (4 Replies)
Discussion started by: ruben.rodrigues
4 Replies

9. Shell Programming and Scripting

How to schedule a cronjob to run every 15 mins ?

Hi, I want to schedule a job to run every 15 mins through cron. searched the forums and came up with this piece of code.i have given this in my crontab 0-59/15 * * * * sh /usr/ss/job But its not being run. Have i made any mistake here. Can any1 post the cron code for scheduling the... (5 Replies)
Discussion started by: suresh_kb211
5 Replies

10. UNIX for Advanced & Expert Users

cannot run cronjob

I have the following cron: 0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57 * * * * /v/sysadmin/sysnet/file.pl The .pl has been tried at 755 and 777 The script works if manually run by the web browser or unix command prompt, but I can't get the Cron to do it automatically i went... (3 Replies)
Discussion started by: shahrahulb
3 Replies
Login or Register to Ask a Question