If you are stuck using ntbackup as your only backup software. There is still hope. As much as ntbackup sucks, with the proper commands ntbackup can actually behave well. With some work you can create a decent backup script and schedule it with schtasks or at. And with added programs like blat, you can even have the script email you like the expensive stuff.
Note: you should allways verify your backups and don’t trust any backup automation 100%. With ntbackup I’ve noticed that if it hits a bad hard drive sector or other file system or permission problem then the program will just crash outright. It would be nice if ntbackup would report the bad sector or file and then skip the bad file and try the next one.
Note: I have seen situations where the domain admin can’t run backups scheduled as a task. I usually create a backupadmin account and verify it is a member of the backup operators.
Here is a sample full backup script.
cd D:\NTBACKUPScripts
@ECHO OFF
REM ********************************************
REM ********************************************
REM **** ****
REM **** SETUP Variables ****
REM **** and prepare for email ****
REM **** ****
REM ********************************************
REM ********************************************ECHO Start %~nx0, %DATE%, %time% >> BK.Log.csv
set time1=%date%, %time%
set BKTARGET=\\UNC\d$\PATH\TO\YOUR\DATA
set BKUPNAME=BK.Full_YourBackupFilename.bkf
set Sender=yourmail@yourserver.com
set Receiver=yourmail@yourserver.com
set Host=youremailserver
set ScriptName=%~nx0
set Subject=%computername% %ScriptName%
REM Warning, this next line may word wrap. It needs to end with the word data
set folder=%userprofile%\Local Settings\Application Data\Microsoft\Windows NT\NTBackup\dataREM ********************************************
REM ********************************************
REM ********* END of Section **************
REM ********************************************
REM ********************************************REM ********************************************
REM ********************************************
REM **** ****
REM **** Doing the backup ****
REM **** ****
REM ********************************************
REM ********************************************
cd D:\NTBACKUPScripts
net start vss
ntbackup backup %BKTARGET% /j “%BKUPNAME%” /f Y:\%BKUPNAME% /V:yes
ntbackup backup systemstate /j “SystemState_%BKUPNAME%” /f “Y:\SystemState_%BKUPNAME%”REM ********************************************
REM ********************************************
REM **** ****
REM **** Email the Log files ****
REM **** ****
REM ********************************************
REM ********************************************
ECHO Stop %~nx0, %DATE%, %time% >> BK.Log.csv
set time2=%date%, %time%
NT\NTBackup\data
ECHO Exec-time %time1% to %time2% > “%temp%\%BKUPNAME%.email.txt”
ECHO . >> “%temp%\%BKUPNAME%.email.txt”
REM NOTE: E: (below) represents your backup drive if connected locally
vol e: >> “%temp%\%BKUPNAME%.email.txt”
DIR Y:\%BKUPNAME% | FINDSTR %BKUPNAME% >> “%temp%\%BKUPNAME%.email.txt”
REM Warning, this next line may word wrap. It needs to end with the word %subject%”
blat.exe -bodyF “%temp%\email.txt” -to %Receiver% -f %Sender% -server %Host% -subject “%Subject%”
REM ********************************************
REM ********************************************
REM ********* END of Section **************
REM ********************************************
REM ********************************************
DEL /Q “%temp%\%BKUPNAME%.email.txt”
Here is a sample differential backup script.
cd D:\NTBACKUPScripts
@ECHO OFF
REM ********************************************
REM ********************************************
REM **** ****
REM **** SETUP Variables ****
REM **** and prepare for email ****
REM **** ****
REM ********************************************
REM ********************************************
ECHO Start %~nx0, %DATE%, %time% >> BK.Log.csv
set time1=%date%, %time%
set BKTARGET=\\UNC\d$\PATH\TO\YOUR\DATA
set BKUPNAME=BK.Diff_YourBackupFilename.bkf
set Sender=yourmail@yourserver.com
set Receiver=yourmail@yourserver.com
set Host=youremailserver
set ScriptName=%~nx0
set Subject=%computername% %ScriptName%
REM Warning, this next line may word wrap. It needs to end with the word data
set folder=%userprofile%\Local Settings\Application Data\Microsoft\Windows NT\NTBackup\dataREM ********************************************
REM ********************************************
REM ********* END of Section **************
REM ********************************************
REM ********************************************REM ********************************************
REM ********************************************
REM **** ****
REM **** Doing the backup ****
REM **** ****
REM ********************************************
REM ********************************************
cd D:\NTBACKUPScripts
net start vss
REM Warning, beware of word wrapping on the next 3 lines
ntbackup backup %BKTARGET% /j “%BKUPNAME%” /f Y:\%BKUPNAME% /M differential /V:yes
ntbackup backup systemstate /j “SystemState_%BKUPNAME%” /f “Y:\SystemState_%BKUPNAME%”
REM the following line is for exchange servers
ntbackup backup IS \%computername% DS \%computername% /v:yes /j “Exchange_%BKUPNAME%” /D “Exchange_%BKUPNAME%” /f %Destination%\Exchange_%BKUPNAME%REM ********************************************
REM ********************************************
REM ****
REM **** Email notifications
REM ****
REM ********************************************
REM ********************************************
ECHO Stop %~nx0, %DATE%, %time% >> BK.Log.csv
set time2=%date%, %time%REM ### EMAIL BODY
ECHO Exec-time %time1% to %time2% > “%temp%\%BKUPNAME%.email.txt”
ECHO ————– >> “%temp%\%BKUPNAME%.email.txt”
REM NOTE: E: (below) represents your backup drive if connected locally
vol e: >> “%temp%\%BKUPNAME%.email.txt”
DIR Y:\%BKUPNAME% | FINDSTR %BKUPNAME% >> “%temp%\%BKUPNAME%.email.txt”
REM ### END EMAIL BODY
REM Warning, this next line may word wrap. It needs to end with the word %subject%”
blat.exe -bodyF “%temp%\%BKUPNAME%.email.txt” -to %Receiver% -f %Sender% -server %Host% -subject “%Subject%”
REM ********************************************
REM ********************************************
REM ********* END of Section
REM ********************************************
REM ********************************************
DEL /Q “%temp%\%BKUPNAME%.email.txt”

If you found this information helpful and saved you time or energy how about you buy me a beer by clicking the donate button below!