summaryrefslogtreecommitdiff
path: root/bin/bbackupctl/bbackupctl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'bin/bbackupctl/bbackupctl.cpp')
-rw-r--r--bin/bbackupctl/bbackupctl.cpp19
1 files changed, 12 insertions, 7 deletions
diff --git a/bin/bbackupctl/bbackupctl.cpp b/bin/bbackupctl/bbackupctl.cpp
index 3795cbed..2c41f614 100644
--- a/bin/bbackupctl/bbackupctl.cpp
+++ b/bin/bbackupctl/bbackupctl.cpp
@@ -15,6 +15,8 @@
#include <unistd.h>
#endif
+#include <cstdlib>
+
#include "MainHelper.h"
#include "BoxPortsAndFiles.h"
#include "BackupDaemonConfigVerify.h"
@@ -61,9 +63,7 @@ int main(int argc, const char *argv[])
MAINHELPER_START
-#if defined WIN32 && ! defined NDEBUG
- ::openlog("Box Backup (bbackupctl)", 0, 0);
-#endif
+ Logging::SetProgramName("bbackupctl");
// Filename for configuration file?
std::string configFilename;
@@ -256,7 +256,8 @@ int main(int argc, const char *argv[])
case SyncAndWaitForEnd:
{
// send a sync command
- std::string cmd("force-sync\n");
+ commandName = "force-sync";
+ std::string cmd = commandName + "\n";
connection.Write(cmd.c_str(), cmd.size());
connection.WriteAllBuffered();
@@ -336,13 +337,17 @@ int main(int argc, const char *argv[])
{
if(!quiet)
{
- BOX_INFO("Succeeded.");
+ BOX_INFO("Control command "
+ "sent: " <<
+ commandName);
}
finished = true;
}
else if(line == "error")
{
- BOX_ERROR("Check command spelling");
+ BOX_ERROR("Control command failed: " <<
+ commandName << ". Check "
+ "command spelling.");
returnCode = 1;
finished = true;
}
@@ -352,7 +357,7 @@ int main(int argc, const char *argv[])
MAINHELPER_END
-#if defined WIN32 && ! defined NDEBUG
+#if defined WIN32 && ! defined BOX_RELEASE_BUILD
closelog();
#endif