[Box Backup] Client on laptop questions/suggestions

John Pybus boxbackup@fluffy.co.uk
Tue, 22 Jun 2004 16:37:25 +0100


This is a multi-part message in MIME format.
--------------070300020600000904040709
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit

Ben Summers wrote:
> 
> On 21 Jun 2004, at 17:18, John Pybus wrote:
> 
>> Ben Summers wrote:
>>
>>> OK, here you are:
>>>   http://www.fluffy.co.uk/boxbackup/bin/syncallowpatch-0.06PLUS1.tgz
>>> instructions within the archive. Works with 0.06PLUS1 only. Let me 
>>> know how you get on.
>>
>>
>> Blimey! that's quick.  My first backup with 0.06PLUS1 isn't complete yet,
>> so I think I'll wait a little to try this one out ;-)
> 
> 
> Whoops. I think there's a minor typo in the instructions. It should be
> 
> SyncAllowScript = /path/to/interpreter/or/exe etc

Ben,

I've had a play with this new feature and it seems to be doing the job
well; I might contribute my example script when I've tried it out a 
little more.  I've attached a patch to the exact version of 
BackupDeamon.cpp I'm using (fixes gcc warning on waitpid and logs any 
delay specified by SyncAllowScript).

I've noticed that this feature *isn't* overridden by 'bbackupctl sync'. 
   I'm unsure as to whether it should override by default or not, but if 
not then I think an option to force is needed, maybe 'bbackupctl sync 
-f', or 'bbackupctl force-sync'.

One thing I'd like is the ability to specify an immediate sync on a 
particular subdirectory.  i.e. being able to do a 'bbackupctl sync 
/home/john/vital-project' just after I've finished hacking on it and 
before I grab my laptop and head off for the weekend.  Like 'bbackupctl 
sync' but without the multi-minute wait as it scans my whole directory 
structure, and with bbackupctl not exiting until it's printed 
confirmation that it's done.

While I'm at it: I've noticed that none of that apps have a --version or 
-V flag.

If you have any opinions on if or how these features should be 
implemented, let me know.  Otherwise I'll likely work on some patches 
when I get a bit of free time.

John

--------------070300020600000904040709
Content-Type: text/plain;
 name="syncallowfixes.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="syncallowfixes.patch"

--- syncallowpatch/BackupDaemon.cpp	2004-06-21 15:22:21.000000000 +0100
+++ bin/bbackupd/BackupDaemon.cpp	2004-06-22 15:41:32.000000000 +0100
@@ -632,12 +632,13 @@
 			{
 				// How many seconds to wait?
 				waitInSeconds = BoxConvert::Convert<int32_t, const std::string&>(line);
+				::syslog(LOG_INFO, "Delaying sync by %d seconds (SyncAllowScript '%s')", waitInSeconds, conf.GetKeyValue("SyncAllowScript").c_str());
 			}
 		}
 		
 		// Wait and then cleanup child process
 		int status = 0;
-		::waitpid(pid, &status, NULL);
+		::waitpid(pid, &status, 0);
 	}
 	catch(...)
 	{
@@ -648,7 +649,7 @@
 		if(pid != 0)
 		{
 			int status = 0;
-			::waitpid(pid, &status, NULL);
+			::waitpid(pid, &status, 0);
 		}
 	}
 

--------------070300020600000904040709--