Changeset 2658
- Timestamp:
- 08/03/2010 21:30:10 (2 years ago)
- File:
-
- 1 edited
-
box/RELEASE/0.11rc7/bin/bbackupd/BackupDaemon.cpp (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
box/RELEASE/0.11rc7/bin/bbackupd/BackupDaemon.cpp
r2593 r2658 1018 1018 int waitInSeconds = (60*5); 1019 1019 1020 std::string script(conf.GetKeyValue("SyncAllowScript") + 1021 " \"" + GetConfigFileName() + "\""); 1022 1020 1023 // Run it? 1021 1024 pid_t pid = 0; 1022 1025 try 1023 1026 { 1024 std::string script("\"" + conf.GetKeyValue("SyncAllowScript") + 1025 "\" \"" + GetConfigFileName() + "\""); 1026 1027 std::auto_ptr<IOStream> pscript(LocalProcessStream( 1028 script.c_str(), pid)); 1027 std::auto_ptr<IOStream> pscript(LocalProcessStream(script, 1028 pid)); 1029 1029 1030 1030 // Read in the result … … 1049 1049 { 1050 1050 BOX_ERROR("Invalid output from " 1051 "SyncAllowScript " <<1052 script << ": '" << line << "'");1051 "SyncAllowScript: '" << 1052 line << "' (" << script << ")"); 1053 1053 throw; 1054 1054 } 1055 1055 1056 1056 BOX_NOTICE("Delaying sync by " << waitInSeconds 1057 << " seconds (SyncAllowScript " 1058 << conf.GetKeyValue("SyncAllowScript") 1059 << ")"); 1057 << " seconds due to SyncAllowScript " 1058 << "(" << script << ")"); 1060 1059 } 1061 1060 } … … 1065 1064 { 1066 1065 BOX_ERROR("Internal error running SyncAllowScript: " 1067 << e.what() );1066 << e.what() << " (" << script << ")"); 1068 1067 } 1069 1068 catch(...) … … 1071 1070 // Ignore any exceptions 1072 1071 // Log that something bad happened 1073 BOX_ERROR(" Error running SyncAllowScript '"1074 << conf.GetKeyValue("SyncAllowScript") << "'");1072 BOX_ERROR("Unknown error running SyncAllowScript (" << 1073 script << ")"); 1075 1074 } 1076 1075 … … 2189 2188 { 2190 2189 BOX_INFO("Not notifying administrator about event " 2191 << sEventNames[Event] << " --set NotifyScript "2190 << sEventNames[Event] << ", set NotifyScript " 2192 2191 "to do this in future"); 2193 2192 } … … 2196 2195 2197 2196 // Script to run 2198 std::string script( "\"" + conf.GetKeyValue("NotifyScript") + "\" " +2197 std::string script(conf.GetKeyValue("NotifyScript") + " " + 2199 2198 sEventNames[Event] + " \"" + GetConfigFileName() + "\""); 2200 2199 2201 2200 // Log what we're about to do 2202 2201 BOX_INFO("About to notify administrator about event " 2203 << sEventNames[Event] << ", running script " << script);2202 << sEventNames[Event] << ", running script '" << script << "'"); 2204 2203 2205 2204 // Then do it
Note: See TracChangeset
for help on using the changeset viewer.
