Server Back-up Scripts
5 min
In Multi-User mode, you should configure your database server to make regular backups, as defined in the Multi-User Installation Backups article. However, the configuration of the repository is maintained in a Protege project file that is used by the Protege server. This article provides some template Windows VBS files that are to be used as a template for your installation and for Unix shell scripts.
Repository Configuration Project Backups
backupRepositoryProjectDaily.vbs
' (c)2008 EAS ltd
' Essential Architecture Manager - repository daily backup script
' Backup the repository project file and perform housekeeping on the
' backup directory
' Backup snap-shots the project file and stores it away from Essential
' Backup to tape/off-server is the user's own responsibility
' Edit the locations in this script to control where the backups are made
' from and to.
Dim anFso
Dim aDirectory
Dim aBackupDir
Dim aFileSet
Dim aBackupFile
Dim aProjectSource
Dim aProjectBackup
Set anFso = CreateObject("Scripting.FileSystemObject")
Set aDirectory = anFso.GetFolder("C:EssentialAMRepository")
Set aBackupDir = anFso.GetFolder("C:EssentialAMRepositoryBackups")
aProjectFile = "essential_repository.pprj"
' Now copy the source file to aBackupFilename
aReposProjectFile = aDirectory.Path & "" & aProjectFile
aBackupFilename = aBackupDir.Path & "" & aProjectFile & "_" & Year(Now) & Month
(Now) & Day(Now) & "_" &Hour(Now) & Minute(Now)
Set aProjectSource = anFso.GetFile(aReposProjectFile)
aProjectSource.Copy(aBackupFilename)
' Now do housekeeping
Set aFileSet = aBackupDir.Files
For Each aBackupFile in aFileSet
If DateDiff("d", aBackupFile.DateCreated, Now) > 31 Then aBackupFile.Delete
Next
backupRepositoryProjectHourly.vbs
' (c)2008 EAS ltd
' Essential Architecture Manager - repository daily backup script
' Backup the repository project file and perform housekeeping on the
' backup directory
' Backup snap-shots the project file and stores it away from Essential
' Backup to tape/off-server is the user's own responsibility
' Edit the locations in this script to control where the backups are made
' from and to.
Dim anFso
Dim aDirectory
Dim aBackupDir
Dim aFileSet
Dim aBackupFile
Dim aProjectSource
Dim aProjectBackup
Set anFso = CreateObject("Scripting.FileSystemObject")
Set aDirectory = anFso.GetFolder("C:EssentialAMRepository")
Set aBackupDir = anFso.GetFolder("C:EssentialAMRepositoryBackupsHours")
aProjectFile = "essential_repository.pprj"
' Now copy the source file to aBackupFilename
aReposProjectFile = aDirectory.Path & "" & aProjectFile
aBackupFilename = aBackupDir.Path & "" & aProjectFile & "_" & Year(Now) & Month
(Now) & Day(Now) & "_" &Hour(Now) & Minute(Now)
Set aProjectSource = anFso.GetFile(aReposProjectFile)
aProjectSource.Copy(aBackupFilename)
' Now do housekeeping
Set aFileSet = aBackupDir.Files
For Each aBackupFile in aFileSet
If DateDiff("d", aBackupFile.DateCreated, Now) > 1 Then aBackupFile.Delete
Next
Updated 31 October 2023