[Box Backup-dev] COMMIT r638 - box/chris/general/bin/bbackupctl
boxbackup-dev at fluffy.co.uk
boxbackup-dev at fluffy.co.uk
Thu Jul 6 21:56:38 BST 2006
Author: chris
Date: 2006-07-06 20:56:37 +0000 (Thu, 06 Jul 2006)
New Revision: 638
Modified:
box/chris/general/bin/bbackupctl/bbackupctl.cpp
Log:
* bbackupctl.cpp
- Added a new command to wait for end of next sync, useful for unit tests
Modified: box/chris/general/bin/bbackupctl/bbackupctl.cpp
===================================================================
--- box/chris/general/bin/bbackupctl/bbackupctl.cpp 2006-07-06 20:56:05 UTC (rev 637)
+++ box/chris/general/bin/bbackupctl/bbackupctl.cpp 2006-07-06 20:56:37 UTC (rev 638)
@@ -32,12 +32,13 @@
{
printf("Usage: bbackupctl [-q] [-c config_file] <command>\n"
"Commands are:\n"
- " sync -- start a syncronisation run now\n"
- " force-sync -- force the start of a syncronisation run, "
+ " sync -- start a synchronisation (backup) run now\n"
+ " force-sync -- force the start of a synchronisation run, "
"even if SyncAllowScript says no\n"
" reload -- reload daemon configuration\n"
" terminate -- terminate daemon now\n"
" wait-for-sync -- wait until the next sync starts, then exit\n"
+ " wait-for-end -- wait until the next sync finishes, then exit\n"
" sync-and-wait -- start sync, wait until it finishes, then exit\n"
);
exit(1);
@@ -224,7 +225,8 @@
bool areWaitingForSync = false;
bool areWaitingForSyncEnd = false;
- if(::strcmp(argv[0], "wait-for-sync") == 0)
+ if(::strcmp(argv[0], "wait-for-sync") == 0 ||
+ ::strcmp(argv[0], "wait-for-end") == 0)
{
// Check that it's not in non-automatic mode,
// because then it'll never start
@@ -236,8 +238,15 @@
}
// Yes... set the flag so we know that
- // we're waiting for a sync to start
- areWaitingForSync = true;
+ // we're waiting for a sync to start/end
+ if(::strcmp(argv[0], "wait-for-sync") == 0)
+ {
+ areWaitingForSync = true;
+ }
+ else if (::strcmp(argv[0], "wait-for-end") == 0)
+ {
+ areWaitingForSyncEnd = true;
+ }
}
else if (::strcmp(argv[0], "sync-and-wait") == 0)
{
More information about the Boxbackup-dev
mailing list