[Box Backup] Boxi with 0.10 server?

Paul Nash boxbackup@fluffy.co.uk
Thu, 23 Mar 2006 12:41:07 -0500


>As far as I know, Box Backup 0.10 does NOT work on Cygwin.

I had to do a bit of minor tweaking of "configure" to get it to compile
(forgot exactly what, sorry, but will send info when I re-build from
scratch).  I tried (briefly) but couldn't get it to compile under VC++ or
MinGW, so stuck with Cygwin for now.

The only major problem that I have encountered is as follows:

in bin/bbackupd/BackupClientDirectoryRecord.cpp (around line 731)

in  BackupClientDirectoryRecord::UpdateItems(Backup...

when it tries to execute

       latestObjectID = UploadFile(rParams, ...

*and* the file has been locked by Windows, the upload fails, which throws
an exception, which is caught by:

   catch(BoxException &e)
           {
                     // an error occured -- make return code false, ...
                     allUpdatedSuccessfully = false;
                      // Log it.
                      SetErrorWhenReadingFilesystemObject(rParams, ...
                      // Log error.
                      ::syslog(LOG_ERR, "Error code when uploading was ...

and the process goes on to deal with the next file.  HOWEVER, it looks like
there's still a bunch of data queued up to come back from the server, which
confuses the query for the next file, and the client barfs.  When it
re-starts itself, it hits the same locked file ....

Lather, rinse, repeat.

The fix would be to flush the connection after the error.  The fastest way
for me to do *that* (allowing for data still in transit) is to close the
connection to the server in the "catch()", allowing the client to
automagically re-establish the connection for the next file and get a "good
and clean and fresh, tra-la-la" server connection.

This give us:

     catch(BoxException &e)
             {
                       // an error occured -- make return code false, to ...
                       allUpdatedSuccessfully = false;
                        // Log it.
                         SetErrorWhenReadingFilesystemObject(rParam ...
                        // Log error.
                        ::syslog(LOG_ERR, "Error code when uploading ...
                        rParams.mrContext.CloseAnyOpenConnection();     //
force flush
              }

Crude, but it works for me (so far).  I'm under a lot of time pressure with
this, so whatever works is OK by me.

Meanwhile, I'm going gangbusters with VB, creating a limited GUI and
installer (just enough to let a total neophyte get it installed & choose
what directories to back up), which will just shell out to the Cygwin
executables to do stuff.  I specialise in crude :-).

As my father told me: "If in doubt, use a hammer.  The bigger the doubt,
the bigger the hammer."

	paul