I have following script:
Tgtfile=/data/rse_outbound_feeds/tgtfiles
TEMPFILE=/data/rse_outbound_feeds/scripts/ftp_ap_automation.txt
TEMPFILE1=/data/rse_outbound_feeds/scripts/ftp_ap_automation1.txt
v_filename=$1
v_filename2=$2
echo "open int.inside.rhusa.com 21" > ${TEMPFILE}
echo "user eclipse Pa55w0rd" >> ${TEMPFILE}
echo "cd /opt/apps/integ/eclipse/outbound/eclipse_boxi_ap/" >> ${TEMPFILE}
echo "lcd /data/rse_outbound_feeds/tgtfiles" >> ${TEMPFILE}
echo "put $v_filename" >> ${TEMPFILE}
echo "put $v_filename2" >> ${TEMPFILE}
echo "close int.inside.rhusa.com" >> ${TEMPFILE}
echo "bye" >> ${TEMPFILE}
ftp -n -v < ${TEMPFILE} > $Tgtfile/ftp_ap_automation_soa_output.txt
egrep "Not connected|Login failed|not found|Not found|No such|refused|Failed|error|Error|timed out|Timed out" $Tgtfile/ftp_ap_automation_soa_output.txt > $Tgtfile/ftp_ap_automation_soa_mail_body.txt
if [ $? -eq 0 ]
then
mailx -s "CRITICAL: FTP to SOA failed for AP Automation (Corcentric extracts)" "[email protected]" < $Tgtfile/ftp_ap_automation_soa_mail_body.txt
fi
rm -rf ${TEMPFILE}
rm -rf $Tgtfile/ftp_ap_automation_soa_mail_body.txt
rm -rf $Tgtfile/ftp_ap_automation_soa_output.txt
rm -rf $Tgtfile/ftp_ap_automation_output.txt
When i execute this script it says that '$Tgtfile/ftp_ap_automation_soa_output.txt ' cannot create this file (No such file found). The script has access of '755' and the above file has to be created at run time. I am not able to find why script is not able to create this file. This file will have log information for ftp. From which we would detect if there are any errors while doing ftp and then send out mail to client.
Any help would be appreciated. Thanks in advance.