echo off
rem ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
rem º First, we use LCG/Remind to ask whether or not to load                 º
rem º our print spooler.  Using /i:0 ensures that it will trigger every      º
rem º time the system is reboot.  The /l:3 gives us 3 seconds to answer the  º
rem º question.  If no answer is given, the default is to go ahead and load  º
rem º the spooler.                                                           º
rem º                                                                        º
rem º The file spooler.msg looks like this:                                  º
rem º                                                                        º
rem º      Would you like to load the 64K                                    º
rem º      print spooler?  %C                                                º
rem ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ¼
lcg-rmnd /i:0 /m:spooler.msg /l:3
if errorlevel 3 goto :NOSPOOL
superspl lpt1:/m=64
:NOSPOOL
rem 
rem ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
rem º This runs our disk optimizer, VOPT.EXE no more than once per day  º
rem º (/i:1), and only if it is before 10:00 AM (/tb:1000).             º
rem º          LCG/Remind will track using the date file vopt.dat.  No  º
rem º message will be displayed (/m:).  If the program triggers the     º
rem º errorlevel will be set to 1, otherwise it will be set to 0.       º
rem ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ¼
lcg-rmnd /i:1 /d:vopt.dat /m: /tb:1000
if not errorlevel 1 goto :CHECK2
echo Beginning the Vopt program...
vopt c:
vopt d:
lcg-rmnd /reset /d:vopt.dat 
:CHECK2
rem 
rem 
rem ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
rem º                                                                    º
rem º In general, we do a complete back-up once a month, or whenever     º
rem º we accumulated more than 5 MB of new files.  We do incremental     º
rem º back-ups every 5 days.  The next command line will trigger on      º
rem º the first of each month (/e:01), or, if we are out of the          º
rem º office on the first, will trigger at least every 33 days, or       º
rem º whenever there is more than 5 MB of data on the c: drive in        º
rem º files with their archive bit set (/kt:5000 /pa:a:c:\*.*), but      º
rem º NOT if there has been a backup in the past 4 days (/n:4).  When    º
rem º triggered, it will display the following multiple choice           º
rem º message (/m:month.msg):                                            º
rem º                                                                    º
rem º           You last made a complete disk backup                     º
rem º           on %d, and there are %f files that have                  º
rem º           changed since then (%k KB of data).                      º
rem º                                                                    º
rem º              1 -- Quit                                             º
rem º              2 -- Make an incremental backup (new files only)      º
rem º              3 -- Make a complete disk backup                      º
rem º                                                                    º
rem º              Your Choice -- %c                                     º
rem º                                                                    º
rem º LCG/Remind will return an errorlevel of 0 if not triggered, or,    º
rem º if triggered will set it according to the answer to the            º
rem º question displayed.  Because this is a complicated question we     º
rem º will allow 180 seconds for an answer (/l:180).                     º
rem º                                                                    º
rem ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ¼
lcg-rmnd /i:33 /e:01 /n:4 /kt:5000 /pa:a:c\*.* /d:bu-all.dat /m:month.msg /l:180
if errorlevel 3 goto :COMPLETE
if errorlevel 2 goto :NEWONLY
goto :CHECK3
:COMPLETE
echo Beginning complete backup...
pcbackup c: /b
lcg-rmnd /reset /d:bu-all.dat 
goto :DONE
:CHECK3
rem 
rem 
rem ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
rem º The next series will "force" a backup if it has been more than 10  º
rem º days, suggest one every Monday, if it has been more than 5 days,   º
rem º show a friendly message if the backup has been within the past     º
rem º 5 days.  It determines this by examining the data files bu-all.dat º
rem º (created everytime a complete backup is made), and bu-new.dat      º
rem º (created everytime the new files are backed up).                   º
rem º which the back-up program automatically creates.                   º
rem º                                                                    º
rem º The file force.msg contains this message:                          º
rem º                                                                    º
rem º           The last disk backup was %n days                         º
rem º           ago (on %d).                                             º
rem º                                                                    º
rem º           A new backup is overdue.                                 º
rem º                                                                    º
rem º The file ask.msg contains this message:                            º
rem º                                                                    º
rem º           Your hard disks have not been backed                     º
rem º                                                                    º
rem º           Would you like to run your backup                        º
rem º           program now? %c                                          º
rem º                                                                    º
rem º The file friendly.msg looks like this:                             º
rem º                                                                    º
rem º           Your hard disk was last backed up                        º
rem º           on %d.                                                   º
rem ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ¼
lcg-rmnd /i:10 /d:bu*.dat /m:force.msg /s
if errorlevel 1 goto :NEWONLY                
lcg-rmnd /w:1 /n:5 /d:bu*.dat /m:ask.msg
if errorlevel 3 goto :DONE
if errorlevel 2 goto :NEWONLY
if errorlevel 1 goto :DONE
goto :CHECK4
:NEWONLY
echo Beginning incremental backup (new files only)...
pcbackup c: /m /b
lcg-rmnd /reset /d:bu-new.dat
goto :DONE
:CHECK4
lcg-rmnd /i:0 /d:bu*.dat /m:friendly.msg /l:5 
:DONE
echo Done with remind#2.bat
