[Box Backup-commit] COMMIT r1430 - box/chris/merge/bin/bbackupd

boxbackup-dev at fluffy.co.uk boxbackup-dev at fluffy.co.uk
Thu Mar 22 23:28:07 GMT 2007


Author: chris
Date: 2007-03-22 23:28:07 +0000 (Thu, 22 Mar 2007)
New Revision: 1430

Modified:
   box/chris/merge/bin/bbackupd/BackupClientDirectoryRecord.cpp
Log:
Trace reasons for uploading (or not) each file


Modified: box/chris/merge/bin/bbackupd/BackupClientDirectoryRecord.cpp
===================================================================
--- box/chris/merge/bin/bbackupd/BackupClientDirectoryRecord.cpp	2007-03-22 23:27:18 UTC (rev 1429)
+++ box/chris/merge/bin/bbackupd/BackupClientDirectoryRecord.cpp	2007-03-22 23:28:07 UTC (rev 1430)
@@ -30,6 +30,7 @@
 #include "BackupStoreException.h"
 #include "Archive.h"
 #include "PathUtils.h"
+#include "Logging.h"
 
 #include "MemLeakFindOn.h"
 
@@ -793,10 +794,14 @@
 				if (pDirOnStore != 0 && en == 0)
 				{
 					doUpload = true;
+					BOX_TRACE(filename << ": will upload "
+						"(not on server)");
 				}
 				else if (modTime >= rParams.mSyncPeriodStart)
 				{
 					doUpload = true;
+					BOX_TRACE(filename << ": will upload "
+						"(modified since last sync)");
 				}
 			}
 
@@ -813,6 +818,8 @@
 				> rParams.mMaxUploadWait)
 			{
 				doUpload = true;
+				BOX_TRACE(filename << ": will upload "
+					"(continually modified)");
 			}
 
 			// Then make sure that if files are added with a 
@@ -828,6 +835,8 @@
 				en->GetModificationTime() != modTime)
 			{
 				doUpload = true;
+				BOX_TRACE(filename << ": will upload "
+					"(mod time changed)");
 			}
 
 			// And just to catch really badly off clocks in 
@@ -838,9 +847,20 @@
 				rParams.mUploadAfterThisTimeInTheFuture)
 			{
 				doUpload = true;
+				BOX_TRACE(filename << ": will upload "
+					"(mod time in the future)");
 			}
 		}
 
+		if (!doUpload)
+		{
+			BOX_TRACE(filename << ": will not upload "
+				"(no reason to upload, mod time is "
+				<< modTime << " versus sync period "
+				<< rParams.mSyncPeriodStart << " to "
+				<< rParams.mSyncPeriodEnd << ")");
+		}
+
 		if (doUpload)
 		{
 			// Make sure we're connected -- must connect here so we know whether




More information about the Boxbackup-commit mailing list