Computing.Net > Forums > Programming > Backup all subdirectory files

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Backup all subdirectory files

Reply to Message Icon

Name: unwont
Date: May 8, 2006 at 07:05:41 Pacific
OS: XP SP1
CPU/Ram: 2gb
Comment:

Using Batch files I'm looking to backup files from certain directories to a backup drive. I'm using XCopy to backup some of the smaller folders. But some directories(music directories & subdirectories) only need to backup files that don't already exist in the destination/backup folder. I have an idea that I can use 'Replace' to backup files but I need to use this to search all sub directories as well.

Stef



Sponsored Link
Ads by Google

Response Number 1
Name: Michael J (by mjdamato)
Date: May 8, 2006 at 09:26:50 Pacific
Reply:

XCOPY has many different parameters that you can utilize. You can see a full list here.

You say "some directories(music directories & subdirectories) only need to backup files that don't already exist in the destination". What about files that already exist but which have been updated? Do you want those copied too?

By default XCOPY will not copy files that exist in the destination and have not been modified.

From the link above:

"/d[:mm-dd-yyyy] : Copies source files changed on or after the specified date only. If you do not include a mm-dd-yyyy value, xcopy copies all Source files that are newer than existing Destination files. This command-line option allows you to update files that have changed."

So, just add the /d parameter to your XCOPY command.

Michael J


0

Response Number 2
Name: unwont
Date: May 9, 2006 at 08:43:51 Pacific
Reply:

I will use seperate batch files for different backups. They'll be run at different times.
So I'll replace all files in the smaller sized directories, but for music directories(mp3's which won't be changed) I will use XCOPY with the date parameter to eliminate needlessly overwriting existing files in the destination.

Well, cheers for that man, I completely overlooked the date parameter. I'm in work now so I'll try that later on.

Stef


0

Response Number 3
Name: unwont
Date: May 10, 2006 at 01:12:04 Pacific
Reply:

Yep. This was what I was looking for, cheers for that!

Stef


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More


Make *.ini file Finstr command in Dos



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: Backup all subdirectory files

count of lines in all .txt files www.computing.net/answers/programming/count-of-lines-in-all-txt-files/16721.html

Find all the file from a directory www.computing.net/answers/programming/find-all-the-file-from-a-directory/18102.html

Perl Script Problem www.computing.net/answers/programming/perl-script-problem/7932.html