Changeset 2588


Ignore:
Timestamp:
26/11/2009 21:44:22 (2 years ago)
Author:
chris
Message:

Add location of config file as an additional parameter to the
SyncAllowScript? and the NotifyScript, thanks to Achim J. Latz.

File:
1 edited

Legend:

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

    r2455 r2588  
    10221022        try 
    10231023        { 
     1024                std::string script("\"" + conf.GetKeyValue("SyncAllowScript") +  
     1025                        "\" \"" + GetConfigFileName() + "\""); 
     1026 
    10241027                std::auto_ptr<IOStream> pscript(LocalProcessStream( 
    1025                         conf.GetKeyValue("SyncAllowScript").c_str(), pid)); 
     1028                        script.c_str(), pid)); 
    10261029 
    10271030                // Read in the result 
     
    10451048                                catch(ConversionException &e) 
    10461049                                { 
    1047                                         BOX_ERROR("Invalid output " 
    1048                                                 "from SyncAllowScript '" 
    1049                                                 << conf.GetKeyValue("SyncAllowScript") 
    1050                                                 << "': '" << line << "'"); 
     1050                                        BOX_ERROR("Invalid output from " 
     1051                                                "SyncAllowScript " << 
     1052                                                script << ": '" << line << "'"); 
    10511053                                        throw; 
    10521054                                } 
    10531055 
    10541056                                BOX_NOTICE("Delaying sync by " << waitInSeconds 
    1055                                         << " seconds (SyncAllowScript '" 
     1057                                        << " seconds (SyncAllowScript " 
    10561058                                        << conf.GetKeyValue("SyncAllowScript") 
    1057                                         << "')"); 
     1059                                        << ")"); 
    10581060                        } 
    10591061                } 
     
    21942196 
    21952197        // Script to run 
    2196         std::string script(conf.GetKeyValue("NotifyScript") + ' ' + 
    2197                 sEventNames[Event]); 
     2198        std::string script("\"" + conf.GetKeyValue("NotifyScript") + "\" " + 
     2199                sEventNames[Event] + " \"" + GetConfigFileName() + "\""); 
    21982200         
    21992201        // Log what we're about to do 
    22002202        BOX_INFO("About to notify administrator about event " 
    2201                 << sEventNames[Event] << ", running script '" 
    2202                 << script << "'"); 
     2203                << sEventNames[Event] << ", running script " << script); 
    22032204         
    22042205        // Then do it 
     
    22072208        { 
    22082209                BOX_WARNING("Notify script returned error code: " << 
    2209                         returnCode << " ('" << script << "')"); 
     2210                        returnCode << " (" << script << ")"); 
    22102211        } 
    22112212        else if(Event != SysadminNotifier::BackupStart && 
Note: See TracChangeset for help on using the changeset viewer.