Changeset 2884


Ignore:
Timestamp:
27/03/2011 02:02:19 (14 months ago)
Author:
chris
Message:

Fix abort if the local data directory doesn't exist.

Location:
box/trunk/bin/bbackupd
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • box/trunk/bin/bbackupd/BackupDaemon.cpp

    r2848 r2884  
    574574void BackupDaemon::RunSyncNowWithExceptionHandling() 
    575575{ 
    576         OnBackupStart(); 
    577  
    578         // Do sync 
    579576        bool errorOccurred = false; 
    580577        int errorCode = 0, errorSubCode = 0; 
     
    583580        try 
    584581        { 
     582                OnBackupStart(); 
     583                // Do sync 
    585584                RunSyncNow(); 
    586585        } 
     
    976975void BackupDaemon::OnBackupFinish() 
    977976{ 
    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        } 
    10001006} 
    10011007 
     
    20892095         
    20902096        // 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        } 
    20922107} 
    20932108 
  • box/trunk/bin/bbackupd/bbackupd.cpp

    r2694 r2884  
    4242                BOX_GET_DEFAULT_BBACKUPD_CONFIG_FILE, 
    4343                argc, argv); 
    44         delete gpDaemonService; 
     44        delete gpDaemonService; 
    4545 
    4646#else // !WIN32 
Note: See TracChangeset for help on using the changeset viewer.