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?
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Bill PrewCommented:

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.


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day 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

(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:"
Cloud Class® Course: CompTIA Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

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.

Use wget with the -N switch as that offers this functionality. wget manual can be found at

Here is a link to the Windows version (it is command line based)
tsukrawAuthor Commented:
similar to past script
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
File Sharing Software

From novice to tech pro — start learning today.