2

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 ?

1 Answer 1

2

It doesn't look like the ncftp client supports a find command.

ncftp  -uuser -ppassword box.tld <<EOF                        
find /home/iain -maxdepth 1 -type d -mtime +5 -exec echo {} \;
EOF

NcFTP 3.2.5 (Feb 02, 2011) by Mike Gleason (http://www.NcFTP.com/contact/).
Connecting to 192.168.254.188...
(vsFTPd 2.2.2)
Logging in...
Login successful.
Logged in to box.tld.
find: no such command. <----

See. you even get a nice error message to tell you that.

2
  • Any Alternate solution ? Feb 23, 2013 at 7:28
  • @HimanshuMatta: Not via ftp, it just doesn't have that kind of functionality.
    – user9517
    Feb 23, 2013 at 8:55

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .