Hi,
I have a simple batch file that I created when on NT4 that informs me
which tape to put in the drive depending on the last one used.
I use the 3 generation tape cycle
Mon, Tue, Wed & Thur I make an incremental backup.
Sunday I make a full backup, first to a Week1, Week2, Week3 tape and
then Month1, Month2 and Month3 tapes. 10 in all.
Now daily is fairly easy to do, if it is Wednesday then the Wed tape
should be used, but if the PC has been off for several days, then it
is more likely to be another tape.
The W2K backup program does not appear to work like this, and I was
looking for suggestions as to
a) I might implement a similiar solution on W2K
b) A better way of doing it.
I have seen some posts that use incredibly complicated scripts with
Guids etc. Is there a more simpler way at all?
I've added my batch file below, so as to better explain. I'm currently
using the NT4 backup program in W2K.
TIA
@echo off
rem This file will run the correct type of backup depending on
rem the last one run.
rem Adapted for NTBackup
E:
cd %systemroot%
rem Get rid of memory dump file as its 400MB
rem Set backup type INCremental or FULL
set type=inc
if exist %systemroot%\MON.LOG goto tue
if exist %systemroot%\TUE.LOG goto wed
if exist %systemroot%\WED.LOG goto thu
if exist %systemroot%\THU.LOG goto fri
:mon
set log=mon
echo monday
goto save
:tue
set log=tue
set oldday=mon
goto save
:wed
set log=wed
set oldday=tue
goto save
:thu
set log=thu
set oldday=wed
goto save
:fri
rem delete temp files for weekly backup cycle
del memory.dmp
del c:\temp\*.* /s /q
del d:\temp\*.* /s /q
del e:\temp\*.* /s /q
del e:\winnt\temp\*.* /s /q
del f:\temp\*.* /s /q
del e:\winnt\administrator.000\Local settings\Temp\*.*
rem delete any infected files
del f:\infected\*.* /s /q
set oldday=thu
set type=full
if exist %systemroot%\WEEK1.LOG goto week2
if exist %systemroot%\WEEK2.LOG goto week3
if exist %systemroot%\WEEK3.LOG goto month
:week1
set log=week1
goto save
:week2
set log=week2
set oldweek=week1
goto save
:week3
set log=week3
set oldweek=week2
goto save
:month
set oldweek=week3
if exist %systemroot%\MONTH1.LOG goto month2
if exist %systemroot%\MONTH2.LOG goto month3
:month1
set log=month1
set oldmonth=month3
goto save
:month2
set log=month2
set oldmonth=month1
goto save
:month3
set log=month3
set oldmonth=month2
:save
echo ******************************
echo Insert %log% tape for backup
echo ******************************
rem pause
if %type%==inc goto inc
:full
echo Full backup
rem goto end
%systemroot%\system32\ntbackup4 backup c: d: e: f: /d %log% /hc

n /b
/t normal /l %systemroot%\%log%.log
%systemroot%\system32\ntbackup4 eject
rem pause
if not errorlevel 0 goto abort
goto log
:inc
echo Inc backup
rem goto end
%systemroot%\system32\ntbackup4 backup c: d: e: f: /d %log% /hc

n /b
/t differential /l %systemroot%\%log%.log
%systemroot%\system32\ntbackup4 eject
rem pause
if not errorlevel 0 goto abort
:log
echo Saving log
copy %systemroot%\%log%.log %systemroot%\logs\%log%.log /y
if exist %systemroot%\%oldday%.log del %systemroot%\%oldday%.log
if exist %systemroot%\%oldweek%.log del %systemroot%\%oldweek%.log
if exist %systemroot%\%oldmonth%.log del %systemroot%\%oldmonth%.log
rem goto end
set log=
set oldday=
set oldweek=
set oldmonth=
set type=
%systemroot%\system32\ntbackup4 eject
rsm.exe eject
goto end
:abort
echo %log% > abort.txt
echo *********************************** >> abort.txt
echo Problem with backup >> abort.txt
echo *********************************** >> abort.txt
:end
exit