Hi friends.....Please help me....
I have written script like below.....
#!/bin/ksh (even #!/bin/awk -f also works and I tried)
awk -f program1 filename > filename2
awk -f program2 filename2 > scriptfile
when I run it manullay it is working fine.....I am happy.
when I put it in crontab it is putting me in sad saying
scriptfile not found...but when I do ls -lrt file is there...what is the problem.
should I include WAIT or SLEEP before executing scriptfile...
I gave pull path even in script and tried...I got the same message in MAIL...
permission is okay...for the same permission ksh works manullay..I
have tried too....help please.
On the crontab try giving the full path
/usr/local/.../scriptfile make sure the file permissions for the scriptfile had been set appropriately.
else change it to
chmod 750 scriptfile
Hope this would help you.
Life is a journey, not a destination!
problem in running scripts
I am doing with full path only.....and ofcourse with
chmod 700 scriptfile ......
sTILL it doesn't work.....
I added....'wait' after the chmod and before the ./scriptfile to recognise
the file from the directory....It is interesting..
still it says file not found....but it does chmod 700.....
wait a second,is it (may be) because the shell in awk...?.Please help.
You must preface every file with the correct path if you are running from the crontab. I like to set an environment variable at the beginning of the script to define my directory and then preface the entries in the script with that environment variable.
awk -f $SCRIPT_DIR/program1 $SCRIPT_DIR/filename > $SCRIPT_DIR/filename2
awk -f $SCRIPT_DIR/program2 $SCRIPT_DIR/filename2 > $SCRIPT_DIR/scriptfile
problem in running scr.....
Hi friends Still I have the problem....I have given the full path too....
Please help me out.....
Here is the script I am running......in crontab....
awk -f $SCRIPT_DIR/DBnames /var/opt/oracle/oratab > $SCRIPT_DIR/List_NAMES
awk -f $SCRIPT_DIR/Log_Trim $SCRIPT_DIR/List_NAMES > $SCRIPT_DIR/Trimlog
DUMP=`sqlplus -s system/passwd@SID1 @background_dump_dest.sql`
[[ -f $ALERTLOG ]]; then
cp $ALERTLOG $DUMP/alert_SID1.log.old
tail -100 $ALERTLOG > $DUMP/project/alert_SID1.log
cp $DUMP/project/alert_SID1.log $ALERTLOG
DUMP=`sqlplus -s system/passwd@SID2 @background_dump_dest.sql`
[[ -f $ALERTLOG ]]; then
cp $ALERTLOG $DUMP/alert_SID2.log.old
tail -100 $ALERTLOG > $DUMP/project/alert_SID2.log
cp $DUMP/project/alert_SID2.log $ALERTLOG
..............continues for all sids.....
still it says $SCRIPT_DIR/Trimlog not found....please help.
Click Here to Expand Forum to Full Width