Changeset 1790 for box/chris/general/bin/bbackupctl/bbackupctl.cpp
- Timestamp:
- 03/08/2007 00:29:31 (5 years ago)
- File:
-
- 1 edited
-
box/chris/general/bin/bbackupctl/bbackupctl.cpp (modified) (12 diffs)
Legend:
- Unmodified
- Added
- Removed
-
box/chris/general/bin/bbackupctl/bbackupctl.cpp
r1784 r1790 110 110 111 111 // Read in the configuration file 112 if(!quiet) printf("Using configuration file %s\n", 113 configFilename.c_str()); 112 if(!quiet) BOX_NOTICE("Using configuration file " << configFilename); 114 113 115 114 std::string errs; … … 120 119 if(config.get() == 0 || !errs.empty()) 121 120 { 122 printf("Invalid configuration file:\n%s", errs.c_str());121 BOX_ERROR("Invalid configuration file: " << errs); 123 122 return 1; 124 123 } … … 129 128 if(!conf.KeyExists("CommandSocket")) 130 129 { 131 printf("Daemon isn't using a control socket, "130 BOX_ERROR("Daemon isn't using a control socket, " 132 131 "could not execute command.\n" 133 132 "Add a CommandSocket declaration to the " 134 "bbackupd.conf file. \n");133 "bbackupd.conf file."); 135 134 return 1; 136 135 } … … 154 153 catch(...) 155 154 { 156 printf("Failed to connect to daemon control socket.\n"155 BOX_ERROR("Failed to connect to daemon control socket.\n" 157 156 "Possible causes:\n" 158 157 " * Daemon not running\n" 159 158 " * Daemon busy syncing with store server\n" 160 159 " * Another bbackupctl process is communicating with the daemon\n" 161 " * Daemon is waiting to recover from an error \n"160 " * Daemon is waiting to recover from an error" 162 161 ); 163 164 #if defined WIN32 && ! defined NDEBUG165 BOX_ERROR("Failed to connect to the command socket");166 #endif167 162 168 163 return 1; … … 194 189 &updateStoreInterval, &minimumFileAge, &maxUploadWait) != 4) 195 190 { 196 printf("Config summary didn't decode\n");191 BOX_ERROR("Config summary didn't decode."); 197 192 return 1; 198 193 } … … 200 195 if(!quiet) 201 196 { 202 printf("Daemon configuration summary:\n"203 " AutomaticBackup = %s\n"204 " UpdateStoreInterval = %d seconds\n"205 " MinimumFileAge = %d seconds\n"206 " MaxUploadWait = %d seconds\n",207 autoBackup?"true":"false", updateStoreInterval,208 minimumFileAge, maxUploadWait);197 BOX_INFO("Daemon configuration summary:\n" 198 " AutomaticBackup = " << 199 (autoBackup?"true":"false") << "\n" 200 " UpdateStoreInterval = " << updateStoreInterval << 201 " seconds\n" 202 " MinimumFileAge = " << minimumFileAge << " seconds\n" 203 " MaxUploadWait = " << maxUploadWait << " seconds\n"); 209 204 } 210 205 … … 267 262 if (currentState != 0) 268 263 { 269 printf("Waiting for current sync/error state "270 "to finish... \n");264 BOX_INFO("Waiting for current sync/error state " 265 "to finish..."); 271 266 } 272 267 } … … 311 306 if(line == "start-sync") 312 307 { 313 if (!quiet) printf("Sync started...\n");308 if (!quiet) BOX_INFO("Sync started..."); 314 309 syncIsRunning = true; 315 310 } … … 318 313 if (syncIsRunning) 319 314 { 320 if (!quiet) printf("Sync finished.\n");315 if (!quiet) BOX_INFO("Sync finished.\n"); 321 316 // Send a quit command to finish nicely 322 317 connection.Write("quit\n", 5); … … 327 322 else 328 323 { 329 if (!quiet) printf("Previous sync finished.\n");324 if (!quiet) BOX_INFO("Previous sync finished."); 330 325 } 331 326 // daemon must still be busy … … 341 336 if(!quiet) 342 337 { 343 printf("Succeeded.\n");338 BOX_INFO("Succeeded.\n"); 344 339 } 345 340 finished = true; … … 347 342 else if(line == "error") 348 343 { 349 printf("ERROR. (Check command spelling)\n");344 BOX_ERROR("Check command spelling"); 350 345 returnCode = 1; 351 346 finished = true;
Note: See TracChangeset
for help on using the changeset viewer.
