From: Manie.Coetzee.NZ on
On May 3, 11:33 am, Fox <f...(a)foxmail.in> wrote:
> I've small ftp script. it logins into remote FTP box and download
> files using mget command.
>
> I need to move the logfiles to other directoryfrom remote ftp as soon
> as my "mget" command done.  I've tried mv command using both ftp /
> lftp but its not working. All i want is something as follows on remote
> box
> ftp> lcd /home/me/log/
> ftp> mget *.log
> ftp> mv *.log old/  <-------- this is not working
>
> any help is really appricated

You can't move the file, but you can rename it. What I used to do is
to create a subdir, called retain, and then do a rename of each file
to it. You might find that you can't do a wildcard rename.

Try to use:
ftp> lcd /home/me/log/
ftp> get <FileName1>.log
ftp> rename <FileName1>.log old/<FileName1>.log <-------- old would
be your subdirs name.

Since you're using a script, and would suggest you use a proper
scripting language, like Perl (or whatever you know/like). The thing
is that you start out with a simple small script, but believe me it
will grow with time. Remember to clean up the old (retain) directory
occasionally.