home *** CD-ROM | disk | FTP | other *** search
- /* Backup.REXX - A Tape Backup Scheduler */
- /* $VER: Backup.REXX 1.10 (26.12.93) */
-
- options results
- signal on syntax
- signal on error
-
- /* Start by running CacheX on the UUCP and Fido drive. They're both filled
- with lots and lots of small files, and accessing them uncached is slow. */
-
- address command "run <>nil: sys:System/CacheX device=DH3: buffers=2000"
-
- /* Set the commands you will be using on various days for your backup. */
-
- /* I use logical devices for backups, just in case I want to do a restore
- without overwriting something already there. */
-
- /*
- 0: 60M BootDisk System disk, rarely changed
- 1: 406M Quantum425 BBS File area, small changes daily
- 2: 64M QuantumLPS BBS partition, changed daily
- 3: 109M Quantum UUCP partition, changed daily
- 4: 100M Quantum105 Temp downloads, changed daily
- 5: 148M WrenIII Additional file area, small changes
- 6: 100M Fidonet Fido messages area, changed daily
- */
-
- Level.0 = "tar -cab 120 -f btntape: 0: 1: 2: 3: 6:" /* 525M tape */
- /* Level 0 is a most of system, full backup. Keep this tape for three months. */
- Level.1 = "tar -caAb 120 -f btntape: 0: 1: 2: 3: 6:" /* 250M tape */
- /* Level 1 is a most of system, incremental backup. Keep this tape two months. */
- Level.2 = "tar -cab 120 -f btntape: 2: 3: 4: 5: 6:" /* 525M tape */
- /* Level 2 is a rest of system, full backup. Keep this tape for three months. */
- Level.3 = "tar -caAb 120 -f btntape: 2: 3: 4: 5: 6:" /* 320M tape */
- /* Level 3 is a rest of system, incremental backup. Keep this tape for two months. */
- Level.9 = "tar -cAb 120 -f btntape: 2: 3: 6:" /* 150M tape */
- /* Level 9 is the daily incemental backup. Keep this tape for one week. */
-
- Table = "-tb 120 -f btntape:"
-
- /* Create a Table of Contents for the current tape. */
-
- /* Here's the daily schedule for four weeks. */
-
- /* Sunday Monday Tuesday Wednesday Thursday Friday Saturday */
-
- Day.1 =0; Day.2 =9; Day.3 =9; Day.4 =9; Day.5 =9; Day.6 =9; Day.7 =9
- Day.8 =2; Day.9 =9; Day.10=9; Day.11=9; Day.12=9; Day.13=9; Day.14=9
- Day.15=1; Day.16=9; Day.17=9; Day.18=9; Day.19=9; Day.20=9; Day.21=9
- Day.22=3; Day.23=9; Day.24=9; Day.25=9; Day.26=9; Day.27=9; Day.28=9
-
- /* Determine which day today is */
-
- DayOfCent = Date('C')
- WeekOfCent = DayOfCent % 7
- WeekOfMonth = WeekOfCent // 4
- DayOfWeek = (DayOfCent // 7) + 1
- Today = (WeekOfMonth * 7) + DayOfWeek
-
- /* Perform the actual backup. */
- Level=Day.Today
- Command=Level.Level
- Address command Command
-
- /* Then build a catalog of the contents. */
- Command='tar >BBX:Backups/Table.'||Level Table
- Address command Command
-
- /* Now, shut the CacheX task back off. */
- Address command "Status >t:Status.Results"
-
- Command = ""
-
- Call open(file,'t:Status.Results','R')
- do until EOF(file) = 1
- StatString = readln(file)
- if ~(StatString = "") then parse var StatString . ProcessNumber . . . ProcessName
- if upper(ProcessName) = 'SYS:SYSTEM/CACHEX' then do
- ProcessNumber = strip(ProcessNumber,'T',':')
- Command = "Break" ProcessNumber
- end
- end
- Call close(file)
- if ~(Command = "") then Address command Command
-
- exit
-
- error:
- syntax:
- Command = 'Echo >> BBX:Sysop-0.log '||'"'||'Error in Backups, line '||SIGL||'"'
- Address command Command
-
- exit;
-