Sign in to follow this  
Followers 0
Blue_Drache

Copy Files and Replace Only if Newer

3 posts in this topic

What I'm looking for is similar to ZIP's -f switch (freshen files) ... in other words, it looks at the source and destination file and only overwrites if the source is newer than the destination file.

So... to keep from reinventing the wheel ... is this already out there in the wild?  I can't seem to locate it via search.  If not, I can whip an ugly kludge up.


Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

im pretty sure robocopy with MIR and a few other switches is somewhere along those lines

http://ss64.com/nt/robocopy.html

/XO : eXclude Older - if destination file exists and is the same date

or newer than the source - don’t bother to overwrite it.
/XC | /XN : eXclude Changed | Newer files
/XL : eXclude "Lonely" files and dirs (present in source but not destination)
This will prevent any new files being added to the destination.
/XX : eXclude "eXtra" files and dirs (present in destination but not source)
This will prevent any deletions from the destination. (this is the default)

 

I believe jon uses something like that for his backups, i remember a conversation about it in chat some time ago

But be carefull with MIR it can be tricky to use

This might help as well

'?do=embed' frameborder='0' data-embedContent>>

you could probably change the switches i used

Edited by Chimaera

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Robocopy is nice, and thanks for the suggestion; but is there a UDF that might do the same thing?  That's what I was basically asking.  Like I said, no biggie, I can write one ... it'll look like s*** but ... it'll work.

Edited by Blue_Drache

Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0