416-621-9348 cgreaves@chrisgreaves.com Visit www.ChrisGreaves.com for this image! Chris_GEDC1894_Head (Small).JPG
Home Services Products

Encryption And Off-site Backup Storage (Home) ; Overview ; The Problem ; The Essence Of The Solution ; How Long Does It Take To Do A Backup? ; Assumptions ; Breakdown Of Tasks ; The Stand-Alone Solution ; The Networked Solution ; Let’s Get Started ; Mounting The Backup Drive ; Mounting An Encrypted Drive ; Waiting For The Backup Drive ; Processing Each Local Drive ; RoboCopy New And Later Files ; RoboCopy Parameter Files ; Append Session Details To A Log File ; Shutting Down the Computer ; Review For Local Systems ; Putting Together The Local Backup System ; SUBSTituting A Drive For A Folder ; Assembling The Batch File ; ( TITLE commands ); Running The Backup Batch File ; Examining Our Results ; Waiting For A Set Of Drives ; Issue the Backup Command To A Set Of Drives ; Modifying The Driving Batch File ; What About The Log File? ; The Upgraded Set Of Batch Files ; Encryption of backup data ; What Is Involved In Encrypting A Backup Device? ; ( Advice On Passwords ); What Is Involved In Mounting An Encrypted Device? ; User Mounted Or Automated? ; Using A DOS Batch File To Facilitate Mounting ; Using A DOS Batch File To Facilitate Dismounts ; Making The External Drives Available Across The Network ; Mounting A Shared Drive For Sharing ; Installing On A Networked Computer ; Running On The Big Beige Box ; An Improved Method Of Waiting ; Shutdown Or Restart? ; At Long Last! A Working Version! ; The Backup.BAT file ; The Mount.BAT file ; The ProcessDrive.BAT file ; The Shutdown.BAT File ; The Encryption Process


Loading

Toronto and Mississauga, Friday, December 03, 2010 8:27 AM

Copyright © 1996-2010 Chris Greaves. All Rights Reserved.

The Upgraded Set Of Batch Files

Let’s inspect our new and upgraded set of batch files, designed to make backup copies of a set of local drives on a computer to a set of one or more backup drives.

Backup.BAT

TITLE %0 effect a backup of a local system
::
:: Set the fixed parameters
::
Set Home=C:\SAFE\
Set Backup=X Y
Set LogFile=C:\Safe\LogFile.LOG
Set WaitTime=10
::
:: Wait until the backup drive is mounted
::
call %Home%WaitSet %WaitTime% %Backup%
::
:: Process each valid drive
::
call %Home%AllDrive %Backup%
::
:: Shutdown the Computer system
::
call %Home%ShutDown.BAT
::
REM END

WaitSet.BAT

Title %0 - wait for SET of backup drives to appear
REM parameter 1 should be the wait time in seconds e.g. "120"
REM parameter 2 and on should be the anticipated Drive letters e.g. "X Y"
:Loop
if "%2"=="" goto Finish
call WaitOne %1 %2
call %0 %1 %3 %4 %5 %6 %7 %8 %9
:Finish
REM END

WaitOne.BAT

Title %0 - wait for a backup drive to appear
REM parameter 1 should be the wait time in seconds e.g. "120"
REM parameter 2 should be the anticipated Drive letter and path e.g. "X"
:Loop
if exist %2:\ goto Finish
@echo %0 Waiting for backup drive    %2:\    to be mounted
wait %1
GoTo Loop
:Finish
REM END

AllDrive.BAT

TITLE %0 - Process all available drives
TITLE (%0) %1 %2 %3 %4 %5
REM parameter 1 should be a set of Backup drive letters e.g. "X Y"
if "%1"=="" GoTo Finish
::
:: Process (RoboCopy) each source drive of this computer to a single backup drive
::
For %%a in (G P C D) do call ProcessDrive %%a %1
:: For %%a in (T) do call ProcessDrive %%a %1
::
:: tell the server that this computer has finished with this backup drive.
::
@echo %ComputerName% %Date% %Time% >> %1:\Backup.LOG
::
:: process the next backup drive letter of the set that remain
::
call %0 %2 %3 %4 %5 %6 %7 %8 %9
:Finish
REM END

ProcessDrive.BAT

TITLE %0 - EFFECT THE BACKUP PROCESS FOR A SINGLE DRIVE
REM parameter 1 should be the anticipated Drive letter to be backed up e.g. "C"
REM parameter 2 should be the Backup drive letter e.g. "X"
TITLE (%0) RoboCopy %1:\ %2:\%Computername% /s /r:0 /w:1
RoboCopy %1:\ %2:\%Computername% /s /r:0 /w:1
REM END

ShutDown.BAT

Title %0 - Shut down the computer system
@echo ShutDown inhibited during testing
pause
::	ShutDown.exe -s -f -t 00
REM END

Encryption of backup data


Loading

Toronto and Mississauga, Friday, December 03, 2010 8:27 AM

Copyright © 1996-2010 Chris Greaves. All Rights Reserved.