DFTECH Posted June 3, 2009 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
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now