DFTECH Posted June 3, 2009 Share Posted June 3, 2009 I have two servers, I need to dump the drives from one onto the other. I'm putting together a batch file to do this. It needs to dump to a folder named for each day of the week. If someone with a good understanding of batching could take a quick glance over this and let me know what they think, I'd appreciate it. Be nice because I am relatively new to the batch file game.@echo offREM Delete drives if in use:net use x: /delete /yesnet use y: /delete /yesnet use z: /delete /yesREM Map drives from the server:net use x: \\s1\c$ /yesnet use y: \\s1\d$ /yesnet use z: \\s1\e$ /yesREM Insert backup statement@echo off::variablesset drive=e:\backups\s1set folder=%date:~0,3%set backupcmd=xcopy /s /c /e /h /i /r /k /y%backupcmd% "x:" "%drive%\c\%folder%"%backupcmd% "y:" "%drive%\d\%folder%"%backupcmd% "z:" "%drive%\e\%folder%"REM End backup statementREM Delete drives again..net use x: /delete /yesnet use y: /delete /yesnet use z: /delete /yes Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now