Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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 ?

share|improve this question

1 Answer 1

up vote 2 down vote accepted

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.

share|improve this answer
    
Any Alternate solution ? –  Himanshu Matta Feb 23 '13 at 7:28
    
@HimanshuMatta: Not via ftp, it just doesn't have that kind of functionality. –  Iain Feb 23 '13 at 8:55

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.