Nightly Backup by Batch files

totmachen

Limp Gawd
Joined
Jun 18, 2003
Messages
177
I have 2 PC's running in my room. The main PC is for gaming, internet usage, and studying. The second PC is basically an idle box, so it just folds 24/7. Each PC runs XP until I get into domains for my schooling. Then the folder will be a server and the gaming one will be a client. I have over 40GB's of music that I have built up over time, plus a backup folder of all the programs/tweaks/drivers that I use. I want to do a nightly backup like this:

Gaming PC = A (has 200GB's)
Folding Box = B (has 160GB's...2x80)

A scheduled task on A starts a batch file. The batch file will start in the specified MP3/Backup folder on A, and for each folder/subfolder/file, see if it is on the shared backup folder on B. If it is and is the same, it moves on. If its not, it will copy it over then move on to the next. At the end of the backup, a log file would be nice saying how many files were scanned to be backed up, and how many new ones were. The log file isnt neccessary though.

I do have some batch file experience, but basically dont understand how to do loops. Can anyone help me out on this?

Or, if there is a program anyone could suggest that does this, preferably freeware, suggest away!

Thanks
totmachen
 

Messy

Limp Gawd
Joined
Feb 11, 2004
Messages
163
i don't personally know squat about batch files and logging, but here is an example line from a batch file i have scheduled:

XCOPY d:\stuff\*.* z:\stuff\ /E /D /Y

i'm not that mch help on what t means though... i knew at the time i researched it long ago, but have since forgotten.

this will only copy files on d: which do not exist on z: and skip over unchanged files.

it's also recursive, so it will also get things in d:\stuff\moreStuff

i hope that helps
 

:LJ:

[H]ard|Gawd
Joined
Jun 6, 2002
Messages
1,348
Originally posted by Messy
i don't personally know squat about batch files and logging, but here is an example line from a batch file i have scheduled:

XCOPY d:\stuff\*.* z:\stuff\ /E /D /Y

i'm not that mch help on what t means though... i knew at the time i researched it long ago, but have since forgotten.

this will only copy files on d: which do not exist on z: and skip over unchanged files.

it's also recursive, so it will also get things in d:\stuff\moreStuff

i hope that helps

Actually, I thought the "/Y" meant that it answered Yes to the "do you want to overwrite this?" prompt regardless of the relative state of the files.
 

totmachen

Limp Gawd
Joined
Jun 18, 2003
Messages
177
well damn, I know xcopy, didnt knew it could do this though. I checked the switches and got this:

/Y Suppresses prompting to confirm you want to overwrite an
existing destination file.
/-Y Causes prompting to confirm you want to overwrite an
existing destination file.

so the /y would be needed. Thanks very much, I'll try it out today.

totmachen
 
Top