summaryrefslogtreecommitdiff
path: root/bin/bbackupd/BackupDaemon.h
diff options
context:
space:
mode:
authorChris Wilson <chris+github@qwirx.com>2008-05-28 15:24:05 +0000
committerChris Wilson <chris+github@qwirx.com>2008-05-28 15:24:05 +0000
commit1aaa7a42e7bd65902a07f29881b68acb45255d24 (patch)
treefe8983cd01778c757dea772933ca6654c852ab3c /bin/bbackupd/BackupDaemon.h
parent441373e3cf2b6c1f4f119c4a4b0d494a6645b5c2 (diff)
Track and log file deletions by name.
Split crypto init and file sync process into its own method, to reduce call depth and facilitate calling in process from tests. Differentiate between 3 uses of stat in BackupClientDirectoryRecord by renaming the structures. Use stat instead of lstat when checking the filesystem that's holding an entity, in case it's a symbolic link to a different filesystem.
Diffstat (limited to 'bin/bbackupd/BackupDaemon.h')
-rw-r--r--bin/bbackupd/BackupDaemon.h48
1 files changed, 42 insertions, 6 deletions
diff --git a/bin/bbackupd/BackupDaemon.h b/bin/bbackupd/BackupDaemon.h
index 1d5efd2c..81ebf982 100644
--- a/bin/bbackupd/BackupDaemon.h
+++ b/bin/bbackupd/BackupDaemon.h
@@ -14,13 +14,15 @@
#include <string>
#include <memory>
+#include "BackupClientDirectoryRecord.h"
#include "BoxTime.h"
#include "Daemon.h"
-#include "BackupClientDirectoryRecord.h"
+#include "Logging.h"
#include "Socket.h"
#include "SocketListen.h"
#include "SocketStream.h"
-#include "Logging.h"
+#include "TLSContext.h"
+
#include "autogen_BackupProtocolClient.h"
#ifdef WIN32
@@ -52,10 +54,10 @@ public:
private:
// methods below do partial (specialized) serialization of
// client state only
- bool SerializeStoreObjectInfo(int64_t aClientStoreMarker,
- box_time_t theLastSyncTime, box_time_t theNextSyncTime) const;
- bool DeserializeStoreObjectInfo(int64_t & aClientStoreMarker,
- box_time_t & theLastSyncTime, box_time_t & theNextSyncTime);
+ bool SerializeStoreObjectInfo(box_time_t theLastSyncTime,
+ box_time_t theNextSyncTime) const;
+ bool DeserializeStoreObjectInfo(box_time_t & theLastSyncTime,
+ box_time_t & theNextSyncTime);
bool DeleteStoreObjectInfo() const;
BackupDaemon(const BackupDaemon &);
@@ -111,6 +113,11 @@ public:
private:
void Run2();
+public:
+ void InitCrypto();
+ void RunSyncNow();
+
+private:
void DeleteAllLocations();
void SetupLocations(BackupClientContext &rClientContext, const Configuration &rLocationsConf);
@@ -205,8 +212,15 @@ private:
box_time_t mDeleteUnusedRootDirEntriesAfter; // time to delete them
std::vector<std::pair<int64_t,std::string> > mUnusedRootDirEntries;
+ int64_t mClientStoreMarker;
+ bool mStorageLimitExceeded;
+ bool mReadErrorsOnFilesystemObjects;
+ box_time_t mLastSyncTime;
+ TLSContext mTlsContext;
+
public:
bool StopRun() { return this->Daemon::StopRun(); }
+ bool StorageLimitExceeded() { return mStorageLimitExceeded; }
private:
bool mLogAllFileAccess;
@@ -427,6 +441,28 @@ public:
BOX_INFO("Synchronised file: " << rLocalPath);
}
}
+ virtual void NotifyDirectoryDeleted(
+ int64_t ObjectID,
+ const std::string& rRemotePath)
+ {
+ if (mLogAllFileAccess)
+ {
+ BOX_NOTICE("Deleted directory: " << rRemotePath <<
+ " (ID " << BOX_FORMAT_OBJECTID(ObjectID) <<
+ ")");
+ }
+ }
+ virtual void NotifyFileDeleted(
+ int64_t ObjectID,
+ const std::string& rRemotePath)
+ {
+ if (mLogAllFileAccess)
+ {
+ BOX_NOTICE("Deleted file: " << rRemotePath <<
+ " (ID " << BOX_FORMAT_OBJECTID(ObjectID) <<
+ ")");
+ }
+ }
#ifdef WIN32
public: