Unable to remove files from ftp server using linux script
Dear All,
I am trying to delete files from sftp server using script but unable to do so. Following is the copy of my script.
I have also tried to manually delete files from sftp but getting the same error.
++++++++++++++++++
sftp> mdelete *.jpg
Invalid command.
+++++++++++++++++
Invalid command.
+++++++++++++++++
My script is as
=====================================================
#!/bin/bash
uid=xxxx
pass=xxxx
host=xxx.xxx.xx.xx
#echo "filetransfer"
lftp -u ${uid},${pass} sftp://${host} <<EOF
#echo "filetransfering"
cd /FIN/ERRORDIR/GLStockLedger
pass=xxxx
host=xxx.xxx.xx.xx
#echo "filetransfer"
lftp -u ${uid},${pass} sftp://${host} <<EOF
#echo "filetransfering"
cd /FIN/ERRORDIR/GLStockLedger
mput /opt/ORMS_INT/ctl_temp/*.dat
cd /FIN/DATADIR/GLStockLedger
mdelete *.dat
quit
EOF
EOF
echo "End"
=======================================================
Following is the error i get when i run the above script
0