echo off
rem including the USER.EXE, *.KEY and DB.ICO in the backups 2003-08-12
rem Removed the c:\DCBACKUP reference, all files will now ZIP 
rem to the program directory and be backed-up 5 times. 2002-06-20
rem  Changes to Darcy's file to remove the batch file variables 
rem  such as NEAPPLY, WHATFLP etc. 2002-05-24
rem  db.bat - all backups   ftech-advisor-scout
rem  01/06/12
rem Creates herd backup to Hard drive and to diskette 
rem also backups up the .arc file
rem backups except for ftech are done into c:\dcbackup
 
rem scout - \scout\scout.key
rem dc-on farm - \dc\nondaily.key
rem daily milk herd - \dc\dmh.key
rem ftech - \dc305\305\ftech.key
rem ftech scout - \onfarm\scout\scoutft.key
rem advisor - \dc\advisor.key
rem analyer - \dccon\analyzer.key

rem %1 is Cowfile Name 
rem %2 is the Zip file name a:\%2.???

rem  ftech - %2.ftc
rem  advisor - %2.zip
rem  analyzer - %2.zip
rem  scout - %2.zip
rem  dc on farm - %2.zip
rem  daily milk - %2.zip

cls

echo .
echo .
echo ΙΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ»
echo Ί   This will create a backup copy of the cowfile on the             Ί
echo Ί               hard drive and on a floppy                           Ί
echo Ί                                                                    Ί
echo Ί    Please insert a formatted floppy disk into drive a:             Ί
echo ΘΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΌ
pause

rem  the onfarm scout contains both the scout.key and scoutft.key
rem     always look for the scoutft.key first

if exist ftech.key  	    goto :ftech
if exist scoutft.key  	    goto :ftechsct
if exist advisor.key	    goto :advisor
if exist analyzer.key	    goto :analyzer
if exist scout.key   	    goto :scout
if exist nondaily.key       goto :nondaily
if exist dmh.key            goto :dmh


echo .
echo .
echo ΙΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ»
echo Ί   The version of Dairy Comp 305 that you are running               Ί
echo Ί                 can not be recognized                              Ί
echo Ί              No backup can be attempted                            Ί
echo Ί                                                                    Ί
echo Ί    Please contact (800) 549-4373 For Customer Support              Ί
echo ΘΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΌ
pause
goto end

rem ----------------------------------------------------------------------
rem                          FTECH
rem ----------------------------------------------------------------------

:ftech

cd \dc305\cherds\dcback
rem renaming of previous Harddrive backups  
if exist %2.zt3 del %2.zt3
if exist %2.zt2 ren %2.zt2 %2.zt3
if exist %2.zt1 ren %2.zt1 %2.zt2
if exist %2.ztc ren %2.ztc %2.zt1

cd \dc305\305
pkzip c:\dc305\cherds\dcback\%2.ztc cowfile1.dat semfile1.dat sirefile.305 %2.* 
pkzip c:\dc305\cherds\dcback\%2.ztc *.arc

echo creating new zip file to A drive cowfile
if exist a:\%2.ztc del a:\%2.ztc
copy c:\dc305\cherds\dcback\%2.ztc a:\

echo ΙΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ»
echo Ί         Please wait while the backups are tested.            Ί
echo ΘΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΌ
pkunzip -t c:\dc305\cherds\dcback\%2.ztc
if errorlevel 1 goto badhard
pkunzip -t a:\%2.ztc
if errorlevel 1 goto baddisk
goto done

rem ----------------------------------------------------------------------
rem                          ADVISOR
rem ----------------------------------------------------------------------

:advisor

cd c:\dc

rem renaming of previous Harddrive backups  
if exist %2.zp4 del %2.zp4
if exist %2.zp3 ren %2.zp3 %2.zp4
if exist %2.zp2 ren %2.zp2 %2.zp3
if exist %2.zp1 ren %2.zp1 %2.zp2
if exist %2.zip ren %2.zip %2.zp1

cd \dc
pkzip c:\dc\%2 %1 dcmenu.dat dcsetup.dat *.def user.exe *.key c:\herds\%2\%2.ftd
pkzip c:\dc\%2 %2.gen db.ico sd.com c:\herds\%2\%2.m*

echo creating new zip file to A drive cowfile
if exist a:\%2.zip del a:\%2.zip
copy c:\dc\%2.zip a:\

echo ΙΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ»
echo Ί      Please wait while the compressed copy is tested.        Ί
echo ΘΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΌ
pkunzip -t c:\dc\%2
if errorlevel 1 goto badhard
pkunzip -t a:\%2
if errorlevel 1 goto baddisk
goto done


rem ----------------------------------------------------------------------
rem                          ANALYZER
rem ----------------------------------------------------------------------

:analyzer

cd c:\dccon

rem renaming of previous Harddrive backups  
if exist %2.zp4 del %2.zp4
if exist %2.zp3 ren %2.zp3 %2.zp4
if exist %2.zp2 ren %2.zp2 %2.zp3
if exist %2.zp1 ren %2.zp1 %2.zp2
if exist %2.zip ren %2.zip %2.zp1

cd \dccon
pkzip c:\dccon\%2 %1 dcmenu.dat dcsetup.dat *.def user.exe *.key c:\herds\%2\%2.ftd
pkzip c:\dccon\%2 %2.gen db.ico sd.com c:\herds\%2\%2.m*

echo creating new zip file to A drive cowfile
if exist a:\%2.zip del a:\%2.zip
copy c:\dccon\%2.zip a:\

echo ΙΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ»
echo Ί      Please wait while the compressed copy is tested.        Ί
echo ΘΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΌ
pkunzip -t c:\dccon\%2
if errorlevel 1 goto badhard
pkunzip -t a:\%2
if errorlevel 1 goto baddisk
goto done

rem ----------------------------------------------------------------------
rem                          SCOUT
rem ----------------------------------------------------------------------

:scout

cd c:\scout

rem renaming of previous Harddrive backups  
if exist %2.zp4 del %2.zp4
if exist %2.zp3 ren %2.zp3 %2.zp4
if exist %2.zp2 ren %2.zp2 %2.zp3
if exist %2.zp1 ren %2.zp1 %2.zp2
if exist %2.zip ren %2.zip %2.zp1

cd \scout
pkzip c:\scout\%2 %1 dcmenu.dat *.m* dcsetup.txt user.exe *.key
pkzip c:\scout\%2 *.arc %2.gen dcsetup.dat *.def db.ico sd.com

echo creating new zip file to A drive cowfile
if exist a:\%2.zip del a:\%2.zip
copy c:\scout\%2.zip a:\

echo ΙΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ»
echo Ί         Please wait while the backups are tested.            Ί
echo ΘΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΌ
pkunzip -t c:\scout\%2
if errorlevel 1 goto badhard
pkunzip -t a:\%2
if errorlevel 1 goto baddisk
goto done


rem ----------------------------------------------------------------------
rem                          NONDAILY
rem ----------------------------------------------------------------------

:nondaily

cd c:\dc

rem renaming of previous Harddrive backups  
if exist %2.zp4 del %2.zp4
if exist %2.zp3 ren %2.zp3 %2.zp4
if exist %2.zp2 ren %2.zp2 %2.zp3
if exist %2.zp1 ren %2.zp1 %2.zp2
if exist %2.zip ren %2.zip %2.zp1

cd \dc
pkzip c:\dc\%2 %1 dcmenu.dat dcsetup.dat *.def *.m* user.exe *.key
pkzip c:\dc\%2 *.arc %2.gen dcsetup.txt semfile1.dat db.ico sd.com

echo creating new zip file to A drive cowfile
if exist a:\%2.zip del a:\%2.zip
copy c:\dc\%2.zip a:\

echo ΙΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ»
echo Ί         Please wait while the backups are tested.            Ί
echo ΘΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΌ
pkunzip -t c:\dc\%2
if errorlevel 1 goto badhard
pkunzip -t a:\%2
if errorlevel 1 goto baddisk
goto done


rem ----------------------------------------------------------------------
rem                          DAILY MILK
rem ----------------------------------------------------------------------

:dmh

cd c:\dc

rem renaming of previous Harddrive backups  
if exist %2.zp4 del %2.zp4
if exist %2.zp3 ren %2.zp3 %2.zp4
if exist %2.zp2 ren %2.zp2 %2.zp3
if exist %2.zp1 ren %2.zp1 %2.zp2
if exist %2.zip ren %2.zip %2.zp1

cd \dc
pkzip c:\dc\%2 %1 dcmenu.dat dcsetup.dat *.def *.m* user.exe *.key
pkzip c:\dc\%2 *.arc %2.gen dcsetup.txt semfile1.dat db.ico sd.com

echo creating new zip file to A drive cowfile
if exist a:\%2.zip del a:\%2.zip
copy c:\dc\%2.zip a:\

echo ΙΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ»
echo Ί         Please wait while the backups are tested.            Ί
echo ΘΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΌ
pkunzip -t c:\dc\%2
if errorlevel 1 goto badhard
pkunzip -t a:\%2
if errorlevel 1 goto baddisk
goto done


rem ----------------------------------------------------------------------
rem                          FTECH SCOUT
rem ----------------------------------------------------------------------

:ftechsct

cd \onfarm\scout

echo creating new zip file to A drive cowfile
if exist a:\%2.zip del a:\%2.zip

pkzip a:\%2 %1  

echo ΙΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ»
echo Ί         Please wait while the backups are tested.            Ί
echo ΘΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΌ
pkunzip -t a:\%2
if errorlevel 1 goto baddisk
goto done



rem -----------------------------------------------------------------------

:badhard
cls
echo ΙΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ»
echo Ί   An error was encountered while backing up the cowfile.    Ί
echo Ί                                                             Ί
echo Ί      Ensure that you have space on your hard drive          Ί
echo Ί                     and try again                           Ί
echo ΘΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΌ
pause
goto end

:baddisk
cls
echo ΙΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ»
echo Ί   An error was encountered while backing up the cowfile.    Ί
echo Ί                                                             Ί
echo Ί   You must insert a different formatted disk in drive a:    Ί
echo Ί                     and try again                           Ί
echo ΘΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΌ
pause
goto end

:done
cls
echo .
echo ΙΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ»
echo Ί   Backup successful to harddrive and floppy                 Ί
echo ΘΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΌ
pause

:end


