Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to automate backups utilizing a batch file 2

Status
Not open for further replies.

Nytro

MIS
Dec 24, 2001
25
US
I trying to automate a backup utilizing a batch file. I have Windows 2000 Server and cannot conduct a automatic backup onto an external hard drive. W2k is configured as a member server in it's basic form. The hard drive is setup as a basic disk. I can't seem to get the automatic function to work. Conducting research I have found that a batch file might be needed. Does anyone have an example of a batch file that works? Do I need to insert the batch file in the run line under the backup utility program?


Thank you...
 
Hi there

I use batch files scheduled overnight.

XCOPY /DCY \\ServerNAME\Share\*.??? \\BACKUPSERVER\SHARE
THe /DCY is; only copy newer files, continue even if errors occur on one file, and dont bother waiting for response to overwrite. at the command prompt type "xcopy /?" to see list of arguments.

THen using scheduled tasks set up time and intervals for backup to take place. Remember to set up a dedicated user account with appropriate privalages. Else you will replay a bit of my history losing 6 weeks data because I changed the admin password and forgot the scheduled task had the password. Thats why the dedicated account for backups.

If you get really clever, you can use a bit of shareware to email you the results on a daily basis. If you dont want to use DOS batch, vbs is also pretty easy and a lot more flexible. goto: for example scripts. Hope this helps.
Regards ACO
 
Here you go. First go into NTBackup and create a backup set, call it Full Daily Backup (or change it in the command line below). Next go into Control Panel/Scheduled Tasks and create a scheduled task for backup, then replace the command line with this one. Note that you will need to change this to whatever path you saved the backup set in and you will need to replace the "filename" with the name of the backup file to be created.

This should all be on one line in the scheduled task:

C:\WINNT\system32\NTBACKUP.EXE backup "@C:\Documents and Settings\Administrator\Local Settings\Application Data\Microsoft\Windows NT\NTBackup\data\Full Daily Backup.bks" /F "filename" /V:yes /L:s /M normal /HC:eek:n /UM
 
I cannot get the batch file to work properly... I designed the file under Notepad, but don't have a clue where to insert the command. Should I copy and paste the batch file under the run block "scheduled task options".

Thank you
 
You want to go into scheduled tasks and have it run NTBackup. Then edit the command line for the scheduled task to the text I provided. You don't need a seperate file, but you do need to configure your backup set in NTBACKUP ahead of time and note that its name is in the command line.
 
aco636 and markdmac,

Sorry my response has taken so long to get posted, however I have had nothing but problems. I finally found a solution which was to format the external hard drive utilizing Windows 2000 Server. I used the NTFS format over FAT 32 and the batch files worked as you recommended. This has been a diffcult one for me!

My hats off to both of you.

A big thank you :)
 
I am curretly experiencing a problem with ntbackup.

I am running winAT to run scheduled backup, but /nopoll switch does not erase tape.
I used to use arcserve backup. When changed from arcserve to NT backup it does not overwrite the tape and get stuck with error dialog "it is not a blank tape. please insert blank tape".
I tried to run a batch file only with a command line as a test
"ntbackup /nopoll"
it opens ntbackup, but it does not do anything after opened it.

Anyone help me with this ?

 
We ran into a similar situation going from Backup Exec to NTBackup. In the end we actually purchased new tapes. :-(

I hope you find this post helpful. Please let me know if it was.

Regards,

Mark
 
munenomura

I take it you have created your bks file, where you have selected what to backup.

I have found that to get a reliable backup I have to use few more switches. Here is an example of my backup batch file that I run every day. It should work fine for you aswell with a few changes.

--------------------------------------
REM this to prevet problems with the media datapool you REM need to copy sleep.exe to \winnt\system32
net stop ntmssvc
sleep 60
net start ntmssvc
sleep 60

REM you need to change this to your backup device
rsm.exe refresh /lf"HP C5683A SCSI Sequential Device"
sleep 60

for /f "Tokens=1-4 Delims=/ " %%i in ('date /t') do set dt=%%i-%%j-%%k-%%l
for /f "Tokens=1" %%i in ('time /t') do set tm=-%%i
set tm=%tm::=-%
set dtt=%dt%%tm%
C:\WINNT\system32\ntbackup.exe backup systemstate "@C:\backup\BACKUP.bks" /n "Nameyourbackuphere %dtt%" /d "Nameyourbackup here %dtt%" /v:no /r:no /rs:no /hc:eek:n /m normal /j "%dtt%" /l:s /p "4mm DDS" /UM
REM you have to change /p to your backup device name

rsm.exe eject /PF"Nameyourbackuphere %dtt% - 1" /astart
------------------------------------------------------
That set of switches works with me and is very reliable.

this is what the switches do for you

Systemstate "Specifies that you want to backup system state data registry etc."

bks filename "specifies the name of your backup file remember to change to your path"

/j {"job name"} "name your job in the backup log"

/p {"pool name"} "specifies your media pool where you want to use media"

/v:{yes|no} "verify your data after backup"

/r:{yes|no} "restricts access to this tape for owner or members of the Administrator group"

/l:{f|s|n} "specifies the log file f=full, s=summary, n=none"

/m {backup type} "specifies backup type has to be either: normal, copy, differential, incremential or daily"

/rs:{yes|no} "backup removable storage database"

/hc:{on|off} "use hardware compression if available"

/um "this is the important switch!. Find the first available media, formats it and uses it for the current backup operation. It has to be at the end of the line and should not be enclosed in quotes.

If you have an Exchange server you need to add two more switches.
/ds {"Server name"}
/is {"Server name"}

I hope that explained it...maybe I should write a proper faq about this but someone probably already have.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top