Changeset 2884
- Timestamp:
- 27/03/2011 02:02:19 (14 months ago)
- Location:
- box/trunk/bin/bbackupd
- Files:
-
- 2 edited
-
BackupDaemon.cpp (modified) (4 diffs)
-
bbackupd.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
box/trunk/bin/bbackupd/BackupDaemon.cpp
r2848 r2884 574 574 void BackupDaemon::RunSyncNowWithExceptionHandling() 575 575 { 576 OnBackupStart();577 578 // Do sync579 576 bool errorOccurred = false; 580 577 int errorCode = 0, errorSubCode = 0; … … 583 580 try 584 581 { 582 OnBackupStart(); 583 // Do sync 585 584 RunSyncNow(); 586 585 } … … 976 975 void BackupDaemon::OnBackupFinish() 977 976 { 978 // Log 979 BOX_NOTICE("Finished scan of local files"); 980 981 // Log the stats 982 BOX_NOTICE("File statistics: total file size uploaded " 983 << BackupStoreFile::msStats.mBytesInEncodedFiles 984 << ", bytes already on server " 985 << BackupStoreFile::msStats.mBytesAlreadyOnServer 986 << ", encoded size " 987 << BackupStoreFile::msStats.mTotalFileStreamSize); 988 989 // Reset statistics again 990 BackupStoreFile::ResetStats(); 991 992 // Notify administrator 993 NotifySysadmin(SysadminNotifier::BackupFinish); 994 995 // Tell anything connected to the command socket 996 SendSyncStartOrFinish(false /* finish */); 997 998 // Touch a file to record times in filesystem 999 TouchFileInWorkingDir("last_sync_finish"); 977 try 978 { 979 // Log 980 BOX_NOTICE("Finished scan of local files"); 981 982 // Log the stats 983 BOX_NOTICE("File statistics: total file size uploaded " 984 << BackupStoreFile::msStats.mBytesInEncodedFiles 985 << ", bytes already on server " 986 << BackupStoreFile::msStats.mBytesAlreadyOnServer 987 << ", encoded size " 988 << BackupStoreFile::msStats.mTotalFileStreamSize); 989 990 // Reset statistics again 991 BackupStoreFile::ResetStats(); 992 993 // Notify administrator 994 NotifySysadmin(SysadminNotifier::BackupFinish); 995 996 // Tell anything connected to the command socket 997 SendSyncStartOrFinish(false /* finish */); 998 999 // Touch a file to record times in filesystem 1000 TouchFileInWorkingDir("last_sync_finish"); 1001 } 1002 catch (std::exception &e) 1003 { 1004 BOX_ERROR("Failed to perform backup finish actions: " << e.what()); 1005 } 1000 1006 } 1001 1007 … … 2089 2095 2090 2096 // Open and close it to update the timestamp 2091 FileStream touch(fn.c_str(), O_WRONLY | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR); 2097 try 2098 { 2099 FileStream touch(fn, O_WRONLY | O_CREAT | O_TRUNC, 2100 S_IRUSR | S_IWUSR); 2101 } 2102 catch (std::exception &e) 2103 { 2104 BOX_ERROR("Failed to write to timestamp file: " << fn << ": " << 2105 e.what()); 2106 } 2092 2107 } 2093 2108 -
box/trunk/bin/bbackupd/bbackupd.cpp
r2694 r2884 42 42 BOX_GET_DEFAULT_BBACKUPD_CONFIG_FILE, 43 43 argc, argv); 44 delete gpDaemonService;44 delete gpDaemonService; 45 45 46 46 #else // !WIN32
Note: See TracChangeset
for help on using the changeset viewer.
