I am using this to remove file from remote server
sshpass -p $SERVER_PASSWORD ssh $SERVER_IP 'find '$SERVER_PATH_TO_REMOVE_BACKUP' -maxdepth 1 -type d -mtime +10 -exec rm -rf {} \;'
I want to use ftp account to delete from remote server. I am using this-
ncftp -u"ftpuser" -p"ftppwd" serverIp <<EOF
find '/back/' -maxdepth 1 -type d -mtime +5 -exec rm -rf {} \;
EOF
But unable to delete. Where is the problem ?
Best Answer
It doesn't look like the ncftp client supports a find command.
See. you even get a nice error message to tell you that.