Linux Operating System (MOSC)

MOSC Banner

Unable to remove files from ftp server using linux script

edited Oct 8, 2013 7:57AM in Linux Operating System (MOSC) 4 commentsAnswered
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.
+++++++++++++++++

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
mput /opt/ORMS_INT/ctl_temp/*.dat
cd /FIN/DATADIR/GLStockLedger
mdelete *.dat
quit
EOF
echo "End"
=======================================================
Following is the error i get when i run the above script

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center