FTP Commands


W

Waldy

Hi there,
this is not strictly an XP issue but I could see anywhere
obvious to post.

I am using the FTP command to periodically download and upload files. For
the download, I am issuing an mget * and then an mdelete * command, The
problem with this is that there is the potential for a file to arrive in the
remote folder between the download and deletion commands, meaning that files
can be missed.

Anyone have a more elegant solution?
 
Ad

Advertisements

T

Thee Chicago Wolf [MVP]

Hi there,
this is not strictly an XP issue but I could see anywhere
obvious to post.

I am using the FTP command to periodically download and upload files. For
the download, I am issuing an mget * and then an mdelete * command, The
problem with this is that there is the potential for a file to arrive in the
remote folder between the download and deletion commands, meaning that files
can be missed.

Anyone have a more elegant solution?

http://filezilla-project.org

- Thee Chicago Wolf [MVP]
 
N

Nil

I am using the FTP command to periodically download and upload
files. For the download, I am issuing an mget * and then an
mdelete * command, The problem with this is that there is the
potential for a file to arrive in the remote folder between the
download and deletion commands, meaning that files can be missed.

Anyone have a more elegant solution?

How about using a different tool than Microsoft's FTP, like WGET. You
could invoke WGET twice, the second time with the "-N," or
"--timestamping" switch. It will retrieve only the files that are newer
or weren't there the first time.

WGET can retrieve files by both FTP and HTTP.

<http://www.gnu.org/software/wget/manual/wget.html#Time_002dStamping>

<http://gnuwin32.sourceforge.net/packages/wget.htm>
 
Ad

Advertisements

D

Dan Rogers

Depending on how good a script writer you are you can do this in a script:
1. log on to the ftp site
2. mget the files
3. log off ftp
4. redirect a "dir" list of the files to a temp file
5. massage the temp file into a list of ftp "del" commands.
6. log back onto the ftp site and use the temp file as a command file (-s
option)

This would be doable but painful in cmd shell, maybe not so bad in vbscript,
very easy in a *NIX shell such as bash.

DR
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top