Discussion Locked

Backup batch

0 helpful
9 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
I would like to create a batch file that will beackup indidivual users' files to a server on a daily basis. Just using the xcopy command will accomplish this, but I'm concerned that if they copy files to the server and the next day they intentionally delete some of these files from their hard drives, the copy of those (now unneeded)files still reside on the server. Eventually I'll be faced with over burdening the server! Thanks.

9 replies

by curlergirl

Here's a simple solution that might work - why not include in your batch file at the beginning a command to delete all the files and/or folders that were copied to the server the previous day? Presumably, you're going to have some logical organization and naming of folders on the server end that would make this pretty easy. This way, you'd be "cleaning up" after yourself every day. You're recopying all of the files anyway, and you'd avoid the storage bloat you're worried about. Hope this helps!

by pvp

I'd get over to http://www.fileware.com and check the capabilities of CmdSync, which comes with the registered version of FileSync.

Briefly, FileSync compares two directories (optionally subtrees, too) and syncs the directories in either direction or both, as you choose. That includes deleting files from the destination that are no longer on the source.

OTOH, sometimes having a retained backup copy when the original is deleted, is called, "Whew! Saved my butt!"

by gesquiere.k

Hi,
When you use the ROBOCOPY command (which is included in the NT resource kit) it contains an option /PURGE which will do exactly what you are looking for : delete dest files/dirs that no longer exist in source.

by nettek

I sent you an email with a batch program that should accomplish what you want to do. It was too large to write it here (plus with this new format I can't "enter" and start a new line. It would be all compressed together and too hard to follow). Email me if you have any questions.

This discussion is closed to new replies.