How to use any command in FTP ?
Posted by Scurz on Fri 25 Apr 2008 at 12:09
I wanted to use the "find" command on a FTP space but it's not possible to use this command with any "normal" FTP client. So, I looked for a solution.
Therefore, I discovered curlftpfs. with this tool, it is possible to use any command (whose "find"). Great !Even if the example on the curlftpfs's website is explicit, I'm going to give another fuller example.
# Adapt $USER, $PASSWD & $HOST ; mkdir /root/tmpftp curlftpfs ftp://$USER:$PASSWD@$HOST/ /mnt/directory/And what I wanted to do with "find" :
# Adapt $USER, $PASSWD & $HOST ; mkdir /root/tmpftp curlftpfs ftp://$USER:$PASSWD@$HOST/ /root/tmpftp/ # To remove all files which are older than 5 days. cd /root/tmpftp find ./ -mtime +5 -exec rm -f {} \;
[ Parent | Reply to this comment ]
[ Parent | Reply to this comment ]
[ Parent | Reply to this comment ]
[ Parent | Reply to this comment ]
Hmm, yes, in fact. But with curlftpfs, you can use any command (it's just an argument to use this tool). And it was just an exemple with the "find" command. ;-)
To complement my article (I've forgotten to write it) :
# Adapt $USER, $PASSWD & $HOST ; mkdir /root/tmpftp curlftpfs ftp://$USER:$PASSWD@$HOST/ /root/tmpftp/ cd /root/tmpftp "use any command present with you system"
Please take note, the second command ("curlftpfs ftp://$USER:$PASSWD@$HOST/ /root/tmpftp/") mounts the space FTP.
[ Parent | Reply to this comment ]
[ Parent | Reply to this comment ]
[ Parent | Reply to this comment ]
--
I'm not a comlpete idoit - some prats are missnig.
[ Parent | Reply to this comment ]
If you see random "access denied" or "file not found" messages this might be a solution.
[ Parent | Reply to this comment ]