Quantcast
Channel: UNIX and Linux Forums
Viewing all articles
Browse latest Browse all 16232

Script not working via crontab

$
0
0
Hi,
I have written one script which is connecting to the the database and generating one CSV, it is running fine when i ran it manually though it is throwing any warning but CSV is generating and working fine but same script when i have configured in crontab not working and giving error, kindly help.

script contents:
Code:

#!/bin/bash
sqlplus -s /nolog << EOF
CONNECT plmc/plmb@whb
@csvgenerator.sql
end;
/
EOF

-----------------------------------
Script running successfully as below, running fine



$ sh test.sh
Session altered.
CSV generated

Crontab entry:

Code:

06 00 * * * ksh  ". ./.profile; /data2/users/cmw/PKG12/test_data.sh" > /tmp/testoutput.txt 2>&1

Error :
SP2-0310: unable to open file "csvgenerator.sql "
SP2-0042: unknown command "end" - rest of line ignored.
SP2-0103: Nothing in SQL buffer to run.



Note:
This post is the duplicated one and copying the same with new ID share/get knowledge , as my ID was banned yesterday due to the violation of rule.
have read the rules thoroughly and try to follow the same.

Viewing all articles
Browse latest Browse all 16232

Trending Articles