Link to home
Start Free TrialLog in
Avatar of tsukraw
tsukraw

asked on

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?
ASKER CERTIFIED SOLUTION
Avatar of Bill Prew
Bill Prew

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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
Sorry, typo... I meant: "or like this:" - not "of like this:"
Avatar of Bill Prew
Bill Prew

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
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
Avatar of tsukraw

ASKER

similar to past script