FTP Script? Mget with options to skip duplicates?

ckeleshian

Banned
Jul 4, 2005
19
0
0
I've been unable to find useful help from google searches. I want a script that will login to an ftp and get multiple files, but skip duplicates. It will be logging into a server, and the server will be adding backup files daily, but I don't want to keep copying the same files.

open ftp.ftpsite.com
username
password
binary
mget *.* (OPTIONS to copy all but skip duplicates?)
quit


What would a batch file look like that does this? Thanks!! :D
 

SaigonK

Diamond Member
Aug 13, 2001
7,482
3
0
www.robertrivas.com
I dont think you can do that, the best way is to try it out.
I had this same setup when copying DAT files for mcafee ages ago, it just got the same files and wrote over the existing ones.
 

nweaver

Diamond Member
Jan 21, 2001
6,813
1
0
use a scripting language, get the ls listing and parse through it and the local directory to find what files you need to get.

other option would be mget *.*, then mv *.* archive (move stuff to archive folder) then you would just get what is in one directory.

Perl or nscftp could probably do this pretty easy.
 

randal

Golden Member
Jun 3, 2001
1,890
0
71
yea, I doubt you'll be able to do it easily with just FTP + command line. Use perl/php or something with a built in FTP client, and use the languages scripting ability to drive its ftp client directly.
 

nweaver

Diamond Member
Jan 21, 2001
6,813
1
0
Not sure about command line in windows FTP, but you can write an ftp script, and call it with ftp -s:scriptpath (or something like that)

then you MIGHT be able to do an if exists goto next statement to skip over it. Does vbscript have ftp abilities?