Please Read: Significant Update Planned, Migrating Forum Software This Month

See more
See less

multiple server backup script

  • Filter
  • Time
  • Show
Clear All
new posts

  • multiple server backup script

    well theres a lot of scripts on the net that use nt backup and do various things but i have one of my own that has been growing rapidly since i created it.
    where others are setup for one server, email the log etc i have taken the approach of having a script that can be used with no modification on many servers. Currently this system is being used on about 60+ servers and the output is being parsed into a public folder and directly into a sharepoint (wss on sbs) server for historical. i am also working on expanding a program ive been using to parse the output and report on them to give a one stop sharepoint page of the status of all backups being received.

    im posting this here, as i have found invaluable help from and hope that someone else may find this usefull to use or canibalise.

    the script is broken into 3 parts

    part one, is a variables file
    the primary file that calls the others, and contains no executable components and therefor needs no updating. it contains the only customisation for each site

    part two, is the update file
    it updates the update command file, and the primary backup engine script. it is possible to have them combined but i preferred the updates to be done seperatly with the engine script doing the backup. personal prefernece no real reson. it does the ftp update, the reg keys and other miscelaneous non-backup stuff.

    part three, is the work horse
    does the backup for disk and tape and does the emailing thing to the users specified etc etc etc .

    general overview of script abilities:
    variables based operations from control file
    email logs to centralised support email, and multiple additional email if required
    stop and restart services specified befor backup
    stop and restart services specified for duration of backup
    support for tape and disk backups
    automatic archiving of disk backups for specified itterations
    refresh rsm library for tape problems fix, vss errors fix, and tape log history fix to 100 history files from std 10
    applies disk performance reg keys for disk backup throughput
    display directory listing to check file dates into backup log (to check output of dirctory eg sql bkup files)
    output log file formatted to include source server, client information, date, times, and ntbackup output.
    automatic updates!!!! ftp based updates to centralised server for new editions and backup services in files.
    works from an user id and finds own logs etc

    part 1: demo variables file
    REM ************************************************** ************************************
    REM [email protected]
    REM ************************************************** ************************************
    rem subcomp = [companyname] company short name (no spaces) used for ftp,& mail
    rem ecompany = [[email protected],[email protected]] additional usernames to email log seperated by comma
    rem ttype = [4mm DDS][LTO Ultrium][QIC][8mm AIT1] tape type from examples from ntbackup or rsm
    rem btype = [tape][disk] backup destination
    rem ddir = [none][z:\] directory list source, log files unless specified
    rem ddest = [e:\bkup.bkf] disk destination directory
    rem copybk = [none,z:\] destination of copy of disk backup eg: z:\
    rem rstsvc = [full name of service] restart service name befor backup
    rem stopsvc = [full name of service] stop service name befor and restart after backup.
    rem prtlog = [no][yes] dump log to printer
    rem scriptdir= [\scripts\] script directory on system drive
    rem scriptfl = [daily.bks] backup selections file
    rem mapdrive = [none][t: \\server\share] map a share if needed

    rem ****** Primary variable - change for each site ********
    set ecompany=none
    set ttype=4mm DDS
    set btype=tape
    set ddir=none
    set ddest=e:\bkup.bkf
    set copybk=none
    rem ****** secondary variables - change if needed*******
    set rstsvc=restart service name
    set stopsvr=stop service name
    set prtlog=no
    set scriptdir=\scripts\
    set scriptfl=daily.bks
    set mapdrive=none
    rem ************************************************** ***********************************
    rem ************************************************** ***********************************
    cmd /c bkupdate.cmd
    cmd /c bkengine.cmd

    part 2: the update script bkupdate.cmd
    rem ************************************************** **************************************
    rem Ftp update backup scripts from website
    rem ************************************************** **************************************
    rem do not edit this file, it should not contain anythign that requries changing
    rem it also gets overwritten by download at new version
    rem ************************************************** **************************************
    rem delete old version files & misc, attrib files to allow overwrite from ftp download
    del test.txt
    attrib b*.* -r
    del version*.txt
    del installation*.txt
    del mailsend.exe
    del tools.exe
    rem ************* section to create reg key for current user *************
    echo Windows Registry Editor Version 5.00> ntbackup.reg
    echo [HKEY_CURRENT_USER\Software\Microsoft\Ntbackup\Back up Engine]>> ntbackup.reg
    echo "Max Num Tape Buffers"="16">> ntbackup.reg
    echo "Tape Buffer Size"="1024">> ntbackup.reg
    echo "Logical Disk Buffer Size"="64">> ntbackup.reg
    echo "Max Buffer Size"="1024">> ntbackup.reg
    echo [HKEY_CURRENT_USER\Software\Microsoft\Ntbackup\Log Files]>> ntbackup.reg
    echo "Log File Count"=dword:00000064>> ntbackup.reg
    echo [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\SchedulingAg ent]>> ntbackup.reg
    echo "MaxLogSizeKB"=dword:00000200 >> ntbackup.reg
    regedit /s ntbackup.reg
    rem *************section creating ftp script begins ***********change ftp destination
    echo open yourftpsitegoeshere> ftp.txt
    echo logonusername>> ftp.txt
    echo logonpassword>> ftp.txt
    echo cd ftpbkup>> ftp.txt
    echo mkdir %subcomp%-%computername%>> ftp.txt
    echo cd %subcomp%-%computername%>> ftp.txt
    echo lcd c:\scripts>> ftp.txt
    echo binary>> ftp.txt
    echo mget *.*>> ftp.txt
    echo.>> ftp.txt
    echo.>> ftp.txt
    echo.>> ftp.txt
    echo.>> ftp.txt
    echo.>> ftp.txt
    echo.>> ftp.txt
    echo.>> ftp.txt
    echo.>> ftp.txt
    echo.>> ftp.txt
    echo.>> ftp.txt
    echo.>> ftp.txt
    echo mdelete *.*>> ftp.txt
    echo.>> ftp.txt
    echo.>> ftp.txt
    echo.>> ftp.txt
    echo.>> ftp.txt
    echo.>> ftp.txt
    echo.>> ftp.txt
    echo.>> ftp.txt
    echo.>> ftp.txt
    echo.>> ftp.txt
    echo.>> ftp.txt
    echo.>> ftp.txt
    echo bye>> ftp.txt
    rem *************section creating ftp script ends ***********
    rem ************* call ftp script **********************
    ftp -s:ftp.txt
    rem ************cleanup created files *******************
    del ftp.txt
    del ntbackup.reg
    Last edited by paulss; 17th November 2008, 03:31.