Jump to content
Sign in to follow this  
rogerd2u

Directory/File Copy, if newer

Recommended Posts

rogerd2u

I have almost 10 gigs of data stored on a server shared drive that I want to periodically backup to another system (via script). The majority of the data doesn't change, so I don't want to tie up all the network bandwidth during this process to copy files that already exist on the destination system.

The share has many files which are stored in multiple subdirectories of the share. (No files exist in the root share).

Source = \\Server1\share1

Destination = E:\Backup (Local workstation drive)

When I use the DirCopy("\\Server1\share1", "E:\Backup",1) it overwrites the existing files on drive E:, which takes a HUGE amount of time.

When I use the DirCopy("\\Server1\share1", "E:\Backup",0) it doesn't attempt to copy any of the subdirectories or the files contained therein.

I need a way to script the following:

Copy new (or newer) files/directories/subdirectories From the server share To a local disk folder.


Roger O."When people show you who they are, believe them.” --Mark Twain

Share this post


Link to post
Share on other sites
Lazycat

In any case you need check every file for changes. You can use Larry's file search UDF that return array with found files, then check every file for changes (usually date/time checking enough) and copy only changed/added. Of course, you can modify this UDF and copy files at once.

Share this post


Link to post
Share on other sites
lyledg

You could always use Robocopy from the MS resource kit, that will do a comparrison of the both directory file structures, and only copy over the newer files (if there are any)..

Very easy to implement...

Share this post


Link to post
Share on other sites
rogerd2u

Thanks for the ROBOCOPY suggestion!! That was exactly what I needed.

THANK YOU SO MUCH! :)


Roger O."When people show you who they are, believe them.” --Mark Twain

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  

×