' Thanks to Tim Chadbourne for the inspiration ' He posted the following maintenance components to the BLCKBRD-L list ' This script automates many of them. ' Delete files in the temp directory on your system drive. ' Delete files in the blackboard recycle bin. (\\blackboard\recyclebin\) ' Delete files in the blackboard sessions directory that are older then a day. (\\blackboard\docs\lib\session) ' Prune IIS logs regularly. (Winnt\system32\Logfiles\W3svcX) ' Prune system event logs regularly. ' Rename the Perlex-err.log when it exceeds 10Mb. (\\blackboard\perlex\bin\perlex-err.log) ' Rename the globallog.text when it exceeds 5Mb. (\\blackboard\apps\chameleon\globalLog.text) ' Rename the Windmail.log when it exceeds 5Mb. (\\blackboard\bin\common\Windmail.log) ' Monitor the SESSIONS table in the bb50 database. There should be no timestamps that are over 3 hours old. ' Installation: ' 1. customize the bbfldr variable below ' 2. save the script with a .vbs extension on your bb server ' 3. create an hourly scheduled task that runs this script ' I offer NO warranties on this and strongly encourage you to examine the ' code first. on error resume next Dim fso ' file system object Dim bbfldr ' installation folder for Blackboard bbfldr="E:\Blackboard\" ' customize for your installation set fso=CreateObject("Scripting.FileSystemObject") ' deletes all files and folders that have not been ' modified in the past designated number of hours ' returns true if a sub-folder can be deleted ' false if not function deleteInFolder(fldrpath, howoldinhours) Dim flder, fc, f, bDelete set flder=fso.getfolder(fldrpath) set fc=flder.SubFolders bDelete=true for each f in fc on error resume next bDelete=deleteInFolder(f.path, howoldinhours) if bDelete and datediff("h", f.Datelastmodified, now)>howoldinhours then f.delete end if next set fc=flder.Files for each f in fc on error resume next if datediff("h", f.Datelastmodified, now)>howoldinhours then f.delete else bDelete=false end if next set f=nothing set fc=nothing set flder=nothing deleteInFolder=bDelete end function function deleteWinNTtmpFiles() Dim flder, fc, f set flder=fso.getfolder("C:\WinNT\") set fc=flder.Files for each f in fc on error resume next if Right(f.name, 4)=".tmp" then if datediff("h", f.Datelastmodified, now)>1 then f.delete end if end if next set f=nothing set fc=nothing set flder=nothing end function ' Delete files in the temp directory on your system drive. deleteInFolder "C:\temp\", 1 ' Delete files in the blackboard recycle bin. (\\blackboard\recyclebin\) deleteInFolder bbfldr & "recyclebin\", 1 ' Delete files in the blackboard sessions directory that are older than a day. (\\blackboard\docs\lib\session) deleteInFolder bbfldr & "docs\lib\session\", 24 ' Delete files in mail folder that are older than a day (\\blackboard\apps\unixequiv\mail\") deleteInFolder bbfldr & "apps\unixequiv\mail\", 24 ' Not sure where these come from but dump em anyway deleteWinNTtmpFiles ' Prune IIS logs regularly. (Winnt\system32\Logfiles\W3svcX) ' IIS can be set to chunk these - not dealt with here ' Prune system event logs regularly. ' The Event monitor can be set to rotate at a certain size - not dealt with here ' Rename the Perlex-err.log when it exceeds 10Mb. (\\blackboard\perlex\bin\perlex-err.log) Dim f ' on error resume next ' moving should just cause system to create new ones set f = fso.GetFile(bbfldr & "perlex\bin\perlex-err.log") if f.size>10000000 then f.move(bbfldr & "perlex\bin\" & year(now) & "-" & month(now) & "-" & day(now) & "perlex-err.log") end if ' Rename the globallog.text when it exceeds 5Mb. (\\blackboard\apps\chameleon\globalLog.text) set f = fso.GetFile(bbfldr & "apps\chameleon\globalLog.text") if f.size>5000000 then f.move(bbfldr & "apps\chameleon\" & year(now) & "-" & month(now) & "-" & day(now) & "globalLog.text") end if ' Rename the windmail.log when it exceeds 5Mb. (\\blackboard\apps\unixequiv\windmail.log) set f = fso.GetFile(bbfldr & "apps\unixequiv\windmail.log") if f.size>5000000 then f.move(bbfldr & "apps\unixequiv\" & year(now) & "-" & month(now) & "-" & day(now) & "windmail.log") end if ' Rename the Windmail.log when it exceeds 5Mb. (\\blackboard\bin\common\Windmail.log) ' Level 1 installations don't have this - uncomment for levels that do ' set f = fso.GetFile(bbfldr & "bin\common\Windmail.log") ' if f.size>5000000 then ' f.move(bbfldr & "bin\common\" & year(now) & "-" & month(now) & "-" & day(now) & "Windmail.log") ' end if ' Monitor the SESSIONS table in the bb50 database. There should be no timestamps that are over 3 hours old. ' In SQL Server Enterprise Manager, under the Management area for the BB50 ' database create a new job that runs on some kind of schedule, e.g. ' every 15 minutes. It has a single step, the contents of which are: ' ' EXECUTE remove_sessions_by_timestamp 360, NULL ' ' This runs a BB-created stored procedure that removes any session that is ' older than 360 minutes (6 hours). Obviously, you could alter this number (and ' many recommend 3 hours (180 minutes), but this looks about right to me. set f=nothing set fso=nothing