Article 5FF4F Problem with my script

Problem with my script

by
TravisBrooker
from LinuxQuestions.org on (#5FF4F)
Hi all,

there is my script,

#!/bin/bash
#!/bin/sh
. /home/dd/.sshConPrfl

WORK_DIR="directory; export WORK_DIR
SPOOL_DIR="directory"; export SPOOL_DIR
LOG_DIR=directory; export LOG_DIR
scr_name=scr
file_ext=txt
TODAY=`date +"%Y%m%d"`
LOG_DATE=`date +"%Y%m%d%H%M%S"`

sqlplus "my connection" @$WORK_DIR/mytest.sql $SPOOL_DIR/$scr_name"_"$TODAY".tmp"
$WORK_DIR > $LOG_DIR/$scr_name"_"$TODAY.log 2>&1

mv $SPOOL_DIR/$scr_name"_"$TODAY".tmp" $SPOOL_DIR/$scr_name"_"$TODAY"."$file_ext

when i run it in crontab, i saw the error below;
myscript.sh: line 29: sqlplus: command not found
mv: cannot stat /20210317.tmp': No such file or directory

but it works fine when i am running it with nohup. what could be the reason about why this script is not working with crontab? i checked the permissions and it seems fine. do you have any idea?

thannk you in advance.latest?d=yIl2AUoC8zA latest?i=XUx4xzPOJ1k:0RMRaN0nBGQ:F7zBnMy latest?i=XUx4xzPOJ1k:0RMRaN0nBGQ:V_sGLiP latest?d=qj6IDK7rITs latest?i=XUx4xzPOJ1k:0RMRaN0nBGQ:gIN9vFwXUx4xzPOJ1k
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments