|
|
|
|
||||||
| comp.unix.shell Using and programming the Unix shell. |
![]() |
|
|
LinkBack | Outils de la discussion |
|
|
#1 |
|
Messages: n/a
Hébergeur: |
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 is really appricated |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
In news:7885cc08-7f8d-49ef-afa5-36512b3b1a8b@u12g2000prd.googlegroups.com,
Fox <fox@foxmail.in> typed: > ftp> mv *.log old/ <-------- this is not working > > any is really appricated To fully "appricate" any , you should invoke it by typing or ? while connected to the ftp server to see the list of available commands. mv is not one of them unfortunately, but you might be interested in rename. |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
On May 3, 11:33am, Fox <f...@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 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. |
|
![]() |
| Outils de la discussion | |
|
|