[Box Backup-commit] COMMIT r1235 - box/chris/merge/bin/bbackupd
boxbackup-dev@fluffy.co.uk
boxbackup-dev@fluffy.co.uk
Thu, 11 Jan 2007 23:01:30 +0000
Author: chris
Date: 2007-01-11 23:01:30 +0000 (Thu, 11 Jan 2007)
New Revision: 1235
Modified:
box/chris/merge/bin/bbackupd/BackupClientDirectoryRecord.cpp
box/chris/merge/bin/bbackupd/BackupClientDirectoryRecord.h
box/chris/merge/bin/bbackupd/BackupDaemon.h
Log:
Added logging of directory scans and excluded files. (refs #3)
Modified: box/chris/merge/bin/bbackupd/BackupClientDirectoryRecord.cpp
===================================================================
--- box/chris/merge/bin/bbackupd/BackupClientDirectoryRecord.cpp 2007-01-11 22:47:35 UTC (rev 1234)
+++ box/chris/merge/bin/bbackupd/BackupClientDirectoryRecord.cpp 2007-01-11 23:01:30 UTC (rev 1235)
@@ -199,6 +199,9 @@
DIR *dirHandle = 0;
try
{
+ rParams.GetProgressNotifier().NotifyScanDirectory(
+ this, rLocalPath);
+
dirHandle = ::opendir(rLocalPath.c_str());
if(dirHandle == 0)
{
@@ -288,6 +291,11 @@
// Exclude it?
if(rParams.mrContext.ExcludeFile(filename))
{
+ rParams.GetProgressNotifier()
+ .NotifyFileExcluded(
+ this,
+ filename);
+
// Next item!
continue;
}
@@ -302,6 +310,11 @@
// Exclude it?
if(rParams.mrContext.ExcludeDir(filename))
{
+ rParams.GetProgressNotifier()
+ .NotifyDirExcluded(
+ this,
+ filename);
+
// Next item!
continue;
}
@@ -316,6 +329,9 @@
"%d (%s)", type,
filename.c_str());
#endif
+ rParams.GetProgressNotifier()
+ .NotifyUnsupportedFileType(
+ this, filename);
SetErrorWhenReadingFilesystemObject(
rParams, filename.c_str());
continue;
@@ -329,6 +345,11 @@
// but now we need the information.
if(::lstat(filename.c_str(), &st) != 0)
{
+ rParams.GetProgressNotifier()
+ .NotifyFileStatFailed(this,
+ filename,
+ strerror(errno));
+
// Report the error (logs and
// eventual email to administrator)
SetErrorWhenReadingFilesystemObject(
Modified: box/chris/merge/bin/bbackupd/BackupClientDirectoryRecord.h
===================================================================
--- box/chris/merge/bin/bbackupd/BackupClientDirectoryRecord.h 2007-01-11 22:47:35 UTC (rev 1234)
+++ box/chris/merge/bin/bbackupd/BackupClientDirectoryRecord.h 2007-01-11 23:01:30 UTC (rev 1235)
@@ -52,6 +52,15 @@
const BackupClientDirectoryRecord* pDirRecord,
const std::string& rLocalPath,
const std::string& rErrorMsg) = 0;
+ virtual void NotifyFileExcluded(
+ const BackupClientDirectoryRecord* pDirRecord,
+ const std::string& rLocalPath) = 0;
+ virtual void NotifyDirExcluded(
+ const BackupClientDirectoryRecord* pDirRecord,
+ const std::string& rLocalPath) = 0;
+ virtual void NotifyUnsupportedFileType(
+ const BackupClientDirectoryRecord* pDirRecord,
+ const std::string& rLocalPath) = 0;
virtual void NotifyFileReadFailed(
const BackupClientDirectoryRecord* pDirRecord,
const std::string& rLocalPath,
Modified: box/chris/merge/bin/bbackupd/BackupDaemon.h
===================================================================
--- box/chris/merge/bin/bbackupd/BackupDaemon.h 2007-01-11 22:47:35 UTC (rev 1234)
+++ box/chris/merge/bin/bbackupd/BackupDaemon.h 2007-01-11 23:01:30 UTC (rev 1235)
@@ -224,6 +224,30 @@
BOX_WARNING("Failed to list directory: " << rLocalPath
<< ": " << rErrorMsg);
}
+ virtual void NotifyFileExcluded(
+ const BackupClientDirectoryRecord* pDirRecord,
+ const std::string& rLocalPath)
+ {
+ if (mLogAllFileAccess)
+ {
+ BOX_INFO("Skipping excluded file: " << rLocalPath);
+ }
+ }
+ virtual void NotifyDirExcluded(
+ const BackupClientDirectoryRecord* pDirRecord,
+ const std::string& rLocalPath)
+ {
+ if (mLogAllFileAccess)
+ {
+ BOX_INFO("Skipping excluded directory: " << rLocalPath);
+ }
+ }
+ virtual void NotifyUnsupportedFileType(
+ const BackupClientDirectoryRecord* pDirRecord,
+ const std::string& rLocalPath)
+ {
+ BOX_WARNING("Ignoring file of unknown type: " << rLocalPath);
+ }
virtual void NotifyFileReadFailed(
const BackupClientDirectoryRecord* pDirRecord,
const std::string& rLocalPath,