Changeset 852 for branches/scripts/server
- Timestamp:
- Feb 19, 2014, 6:26:31 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/scripts/server/chktdb.cmd
r779 r852 1 /* 2 3 Samba Server for eComStation (OS/2) tools 4 5 (c) 2013 Herwig Bauernfeind for bww bitwise works GmbH. 6 Script: ChkTDB.CMD, requires REXX and tdbtool.exe from Samba 3.3 or better. 7 Purpose: Test the integrity of all TDB files in the current diectory. 8 In case a TDB file fails the integrity check the resulting 9 logfile is preserved and carries a name of xxx.tdb.err 10 Syntax: No parameters. 11 12 */ 13 14 call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs' 15 call SysLoadFuncs 1 /* Test all Samba TDB files for integrity 2 Version 1.2 (c) 2013 by Herwig Bauernfeind 3 for bww bitwiseworks GmbH. */ 16 4 17 5 ok = SysFileTree("*.TDB",tdb.,'FO') 18 6 7 error = 0 8 19 9 do I = 1 to tdb.0 20 call charout , left(filespec('N',tdb.I), 2 4)10 call charout , left(filespec('N',tdb.I), 22) 21 11 address cmd '@tdbtool 'tdb.I' check 2>'tdb.I'.err 1>'tdb.I'.out' 22 12 out = linein(tdb.I'.out') 23 13 ok = stream(tdb.I'.out','c','close') 24 14 say out 25 if pos('integrity is OK',out) = 0 then call beep 880, 20 15 if pos('integrity is OK',out) = 0 then do 16 call beep 880, 20 17 address cmd '@tdbbackup -s.bak -v 'tdb.I' 2>NUL 1>NUL' 18 error = 1 19 do while lines(tdb.I'.err') > 0 20 errline = linein(tdb.I'.err') 21 select 22 /* skip unnecessary lines of log */ 23 when pos("bww ",errline) > 0 then iterate 24 when pos("fcntl",errline) > 0 then iterate 25 otherwise say copies(' ',22)'Cause: 'errline'!' 26 end 27 end 28 ok = stream(tdb.I'.err','c','close') 29 end 26 30 else do 27 31 ok = SysFileDelete(tdb.I'.err') 28 32 ok = SysFileDelete(tdb.I'.out') 33 address cmd '@tdbbackup -s.bak 'tdb.I' 2>NUL 1>NUL' 29 34 end 30 35 end
Note:
See TracChangeset
for help on using the changeset viewer.