Help - Search - Members - Calendar
Full Version: batch file to copy backup information
Neowin Forums > Windows Support > Windows NT4/2000/2003/2008 Server
littleneutrino
Currently i am using the backup utility that is part of Windows NT Server However, i have notice that it has not been backup up as often as it should (every evening) i have a BKS file which contains the locations of each directory that needs backed up.
Could someone write a batch file that i could schedule to run that would copy this data to a Mapped directory (Network Storage)

Here is the contents of the BKS file. and if possible i would need it to replace the previous nights data.

CODE
C:\
C:\appservice\ /Exclude
C:\Dell\ /Exclude
C:\Documents and Settings\ /Exclude
C:\JACADA\ /Exclude
C:\Program Files\ /Exclude
C:\RECYCLER\ /Exclude
C:\temp\ /Exclude
C:\test\ /Exclude
C:\tmp\ /Exclude
C:\WINNT\ /Exclude
C:\System Volume Information\ /Exclude

E:\
E:\bin\ /Exclude
E:\Config.Msi\ /Exclude
E:\downloads\ /Exclude
E:\ETIME\ /Exclude
E:\Golf Galaxy\ /Exclude
E:\Golfworks Intranet\ /Exclude
E:\msdownld.tmp\ /Exclude
E:\Program Files\ /Exclude
E:\RECYCLER\ /Exclude
E:\System Volume Information\ /Exclude
E:\TEMP\ /Exclude
E:\winnt\ /Exclude
E:\WUTemp\ /Exclude


Any help is always appreciated thank you.
sc302
Xcopy /s /e /y c:\folder x:\folder

You will have to do that for each folder u want copied.
littleneutrino
would i have to line item every directory or is there a way to tell it to copy everything except for certain file like the BKS file does?
sc302
Line item every directory on the root. Not every directory within the top level directory.
lars77
I believe you can copy while excluding folders using Robocopy with the /xd switch. Dunno if NT Server has it, if not you can grab it here. (assuming it runs on NT Server)

For the C: drive, the command might look something like:
CODE
robocopy c: z:\mynetworkshare\backup /e /xd C:\appservice C:\Dell "C:\Documents and Settings" C:\JACADA "C:\Program Files" C:\RECYCLER C:\temp C:\test C:\tmp C:\WINNT "C:\System Volume Information"


Same for the E: drive, just change the drive & excluded folders.

The quick-and-dirty way, if you want to remove the old backup each day, is to do something like
CODE
rmdir /s /q z:\mynetworkshare\backup

before running robocopy. But there are also switches that can make robocopy copy only files recently created, or with the archive bit set, things like that.

Hope that helps get you going! If you're not comfortable creating batch files you may want to stick with a GUI backup program, such as Cobian Backup or similar. Or figure out why ntbackup doesn't always run on your system.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.