As well as all standard Python functions, PureCM provides some useful utility functions which can be called within the server triggers.
void MakeDatabaseSnapshots ( )
Creates a snapshot of each database as described in Chapter 16, Backup & Restore.
The example below is used to create database snapshots twice a day.
def OnEveryHour(hour): if hour == 13 or hour == 18: MakeDatabaseSnapshots( ) return
void ClearEventLog ( number Days )
Deletes events from the event log as described in Chapter 13, Event Log. The Days specifies the number of days in which events should not be deleted.
The example below is used to clear all events which are more than 30 days old.
def OnEveryHour(hour): if hour == 2: ClearEventLog( 30 ) return
void TruncateDatabaseLogs ( )
Creates a log archive and clear the active log. This should be performed after making a backup to stop the active log file getting too big.
The example below is used to archive the log every night.
def OnEveryHour(hour): if hour == 23: TruncateDatabaseLogs( ) return