command line FTP compare timestamp for overwrite

Hey Experts,
I currently have been using ncftpget to be able to script FTP file transfers.  I have looked through the documentating and maybe i am missing it but does anyone know if there is a way with ncftp or any other command line FTP programs to be able to compare time stamps on files and if they are different overwrite them?
tsukrawAsked:
Who is Participating?
 
Bill PrewConnect With a Mentor Commented:
Tuck,

You know we do something like this in the current scripts, right?  But we do it manually, pulling the files from the server to a staging folder, then comparing outside of ftp to the current local files.  If anything changed we overwrite the local one from staging.

~bp
0
 
t0t0Commented:
You can do it by popping out to DOS and then back into FTP again.

For example, to pop out to DOS using FTP, use the '!' command like this:

   ! echo ok

of like this:

   !
   call ProcessFile
   exit

(or something along those lines)

The 'exit' pops you back into your FTP session
0
 
t0t0Commented:
Sorry, typo... I meant: "or like this:" - not "of like this:"
0
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 
Bill PrewCommented:
Take the following approach.  On the server keep two directories, one is the master list of the current version of all files, let's call it "master".  The other, let's call it "updates", will contain just files when they are updated on the server.  So, on the server, whenever a file is updated, copy it to both "master" and "updates".  Then, using ncpftpget, pull from the "updates" dirctory, and use the -DD option to selete them after the transfer.

~bp
0
 
doby48Commented:
Use wget with the -N switch as that offers this functionality. wget manual can be found at http://www.gnu.org/software/wget/manual/wget.html.

Here is a link to the Windows version (it is command line based) http://gnuwin32.sourceforge.net/packages/wget.htm
0
 
tsukrawAuthor Commented:
similar to past script
0
All Courses

From novice to tech pro — start learning today.