probs executing crontab script


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers probs executing crontab script
# 1  
Old 02-15-2009
probs executing crontab script

Hi everyone

In an existing crontab script for the root user, I've added 5 new lines of code, however for some unknown reason, these lines of code were not executed.

Here is what I did

Code:
30 0 * * * ./usr/people/atlab/jamesgoh/disk_reader/disk_reporter /picnic
30 0 * * * ./usr/people/atlab/jamesgoh/disk_reader/disk_reporter /paradise
30 0 * * * ./usr/people/atlab/jamesgoh/disk_reader/disk_reporter /chopper
30 0 * * * ./usr/people/atlab/jamesgoh/disk_reader/disk_reporter /bliss
30 0 * * * ./usr/people/atlab/jamesgoh/disk_reader/disk_reporter /nugget

The general idea is that at 12:30 am (that is midnight + 30 mins) each night a C-program called disk_reporter runs to gather disk usage information on the parameter disks (picnic, chopper, bliss, nugget).

If im not mistaken, the syntax of my code above should be correct

Also, when doing an ls -al, I found that the root crontab file (the one Im editing) has read only permsissions for all users and groups in general (it was showing -r--r--r--), however given that I was able to add 5 extra lines of code this is quite bizzare.

However Im still not sure what I've done wrong ? Can anyone help me out here ?
# 2  
Old 02-15-2009
what error message from the cron log or any other error messages ??
# 3  
Old 02-15-2009
Forgive my ignorance, but how do I put error message checking in the command line or crontab script ?
# 4  
Old 02-15-2009
Ok I realised that some causes of the error was not removing the . when specifying the executable (as Im not running it from the directory the executable is in) and using the machine's timestamp (I was using a remote machine's timestamp)

However, the script only worked when we did the adjustements from my boss's machine (he has remote access to the machine the cron script is run from) and not mine.


Im still at lost as to what I could be doing wrong ?
# 5  
Old 02-15-2009
basically to schedule a cron job, just need to ensure the script with path is executable, test to run it manually with right account. Then schedule in crontab and monitor the cron log (eg. /var/log/cron) depend on which unix platform...
# 6  
Old 02-16-2009
See the cron log (usually /usr/adm/cron/log) to see whether the cron ran at all and if it failed with an exit code (rc=n).
Untrapped errors from root cron will be found in root mail.
You can only edit the root cron if you have root permissions.
The cron daemon will only notice the changes to a crontab if they were made with the appropriate "crontab" command or cron itself was restarted.
# 7  
Old 02-16-2009
Hi everyone

I finally managed to get my crontab script to work.

The problem was that I was not doing the editting via crontab -e, which is necessary to update the existing crontab file.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Debian

Problems with Crontab not executing scripts after edit

Hi all I installed Debian and i have a few scripts that outputs what is happening. The wierd part...after fresh install all works ok but after i open or edit Crontab it stops executing the scripts...and scripts runs manually so its not a problem with scripts...what happens is that i usually... (3 Replies)
Discussion started by: ro0t3d
3 Replies

2. Shell Programming and Scripting

Script not executing in CRONTAB

Hi, I have written a script for file scan : #!/bin/sh find . -name "common.log.diff" > /dev/null 2>&1 if ; then cp common.log common.log.diff diff common.log common.log.diff > DIFFERENCE.log cp common.log common.log.diff grep "ERROR" DIFFERENCE.log if ; then echo "1" >... (6 Replies)
Discussion started by: himvat
6 Replies

3. UNIX for Dummies Questions & Answers

hi probs with rm command

hi guys... i m using rm *.zip or rm -rf *.zip while removing from a server path recursively, i m getting "Remove directory operation failed." if i use rm* .zip i m getting as invalid command and none of the files are removed.. please help where m i wrong when i execute the... (13 Replies)
Discussion started by: madhu_aqua14
13 Replies

4. UNIX for Advanced & Expert Users

Executing in crontab

Hi, if I launche this at commande line It is OK : $ /home/oracle/anaschxt_A01_5_15_25_plemae.sh but if I put it in crontab : Like this : I have this error : /home/oracle/anaschxt_A01_5_15_25_plemae.sh: sqlplus: not find. The script is : +17 ... (2 Replies)
Discussion started by: big123456
2 Replies

5. Shell Programming and Scripting

Problem with executing a script scheduled in crontab

Hi I have written a shell script(in Solaris) in which following logic is there..... i=1 while read control do key=`echo $control | awk -F$DELIMITOR '{ print $1 }'` echo "Key Values" ${key} i=`/usr/bin/expr $i + 1` done < $CONFPATH/$CONFFILE when i execute it at prompt it... (4 Replies)
Discussion started by: Amardeep
4 Replies

6. Shell Programming and Scripting

Overlapping(executing time) jobs in crontab

I do not have the luxery of a server that i can try on, so i had to post my qn here. Say i have two jobs in the cron table, the jobs are scheduled 2 mins apart. Assuming the first jobs does a lot of operations and takes > 2 mins. Will the second job be executed? Will Unix actually have a queue... (3 Replies)
Discussion started by: new2ss
3 Replies

7. Solaris

More SSH probs ...

Server 1 SSH Version Sun_SSH_1.0 Server 2 OpenSSH_3.8.1p1 Server 3 OpenSSH_3.8p1 I created the rsa keys on server1. Public and private. I copied the id_rsa.pub file to server2 and server3 and appended this to the authorized_keys file in the .ssh directory on both. (All servers using the root... (2 Replies)
Discussion started by: frustrated1
2 Replies

8. UNIX for Dummies Questions & Answers

copy probs

need help....just wanna copy all files with no extensions but with tree-informations to one dir first I make a new directory with all foldertrees...like find / -name "*" -type d >a1 sed -e 's/^/new/g' <a1 >b1 mkdir -p `cat a1` then I wanna copy all specific files with no... (12 Replies)
Discussion started by: svennie
12 Replies

9. Shell Programming and Scripting

probs compiling lex

this is my lex file ------------ test.l %% printf("%c",yytext+'a'-'A');.ECHO; how do i compile it $ lex test.l cc lex.yy.c -o test -ll <------| | if this is correct do i add this line--------| @the command line or does it... (0 Replies)
Discussion started by: sinner
0 Replies

10. UNIX for Dummies Questions & Answers

oracle probs on HPUX11

Hi all we r using hpUX11.00 9000 sever as oracle 8i db server... But the problem is we have 4 instances of dbs but upto my knowledge there are only to ports available for TNS listen... how can i configure or get wht ever it may be the other two ports for tns listener......... ... (2 Replies)
Discussion started by: Prafulla
2 Replies
Login or Register to Ask a Question