Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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 {} \;

But unable to delete. Where is the problem ?

share|improve this question
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 {} \;

NcFTP 3.2.5 (Feb 02, 2011) by Mike Gleason (
Connecting to
(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


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.