diff options
author | Chris Wilson <chris+github@qwirx.com> | 2008-09-26 22:18:35 +0000 |
---|---|---|
committer | Chris Wilson <chris+github@qwirx.com> | 2008-09-26 22:18:35 +0000 |
commit | 25bd3523fe26b08de0413756673227ccccc332af (patch) | |
tree | a5c0c267bff89f2b849f3f58602d972fb9e39263 /bin/bbackupd/BackupDaemon.h | |
parent | cc17fe1a45f2dd75dea965ec57f1c1c2b1b9223b (diff) |
Add file logging support (LogFile and LogFileLevel config options).
Ensure that backup-finish is always called, and add a new event,
backup-ok, which is called just before backup-finish when the backup
run was successful.
Keep track of the last backup status notification sent (excluding
backup-start and backup-finish) and send a notification whenever it
changes.
Add a new boolean option, NotifyAlways, to override that check and
always send notifications to the NotifyScript after every backup run,
for notify scripts which do their own state tracking or otherwise
require notification on every event.
Diffstat (limited to 'bin/bbackupd/BackupDaemon.h')
-rw-r--r-- | bin/bbackupd/BackupDaemon.h | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/bin/bbackupd/BackupDaemon.h b/bin/bbackupd/BackupDaemon.h index f7d61838..0f946164 100644 --- a/bin/bbackupd/BackupDaemon.h +++ b/bin/bbackupd/BackupDaemon.h @@ -100,17 +100,7 @@ public: int GetState() {return mState;} // Allow other classes to call this too - enum - { - NotifyEvent_StoreFull = 0, - NotifyEvent_ReadError, - NotifyEvent_BackupError, - NotifyEvent_BackupStart, - NotifyEvent_BackupFinish, - NotifyEvent__MAX - // When adding notifications, remember to add strings to NotifySysadmin() - }; - void NotifySysadmin(int Event); + void NotifySysadmin(SysadminNotifier::EventCode Event); private: void Run2(); @@ -119,6 +109,8 @@ public: void InitCrypto(); void RunSyncNowWithExceptionHandling(); void RunSyncNow(); + void OnBackupStart(); + void OnBackupFinish(); private: void DeleteAllLocations(); @@ -213,7 +205,7 @@ private: CommandSocketInfo *mpCommandSocketInfo; // Stop notifications being repeated. - bool mNotificationsSent[NotifyEvent__MAX]; + SysadminNotifier::EventCode mLastNotifiedEvent; // Unused entries in the root directory wait a while before being deleted box_time_t mDeleteUnusedRootDirEntriesAfter; // time to delete them |