[Box Backup] What I miss on boxbackup

Thomas Glanzmann boxbackup@fluffy.co.uk
Thu, 2 Feb 2006 23:21:03 +0100


Hello,
this is my personal feature list which is missing from boxbackup for my
current usage scenario. Maybe I will start to submit a few patches.

        (x) Stay on same filesystem
        ( ) Don't backup bigger files
        ( ) IPv6 support
        ( ) readline tab completion for text interface
        ( ) double '//' bug
        ( ) handle device files, unix sockets and named pipes

I use boxbackup-0.9 to backup the root filesystems of three machines
which works quiet well. I like it better every day. :-)

        Thomas

This patch tells bbackupd to stay on the same filesystem. But it doesn't
touch bbackupclient. So it shouldn't be comitted that way.

--- a/bin/bbackupd/BackupClientDirectoryRecord.cpp
+++ b/bin/bbackupd/BackupClientDirectoryRecord.cpp
@@ -228,6 +228,15 @@
 			struct dirent *en = 0;
 			struct stat st;
 			std::string filename;
+
+                        if(::lstat(rLocalPath.c_str(), &st) != 0)
+                        {
+                                TRACE1("Stat failed for '%s' (contents)\n", rLocalPath.c_str());
+                                THROW_EXCEPTION(CommonException, OSFileError)
+                        }
+
+                        dev_t st_dev = st.st_dev;
+
 			while((en = ::readdir(dirHandle)) != 0)
 			{
 				// Don't need to use LinuxWorkaround_FinishDirentStruct(en, rLocalPath.c_str());
@@ -248,6 +257,12 @@
 					THROW_EXCEPTION(CommonException, OSFileError)
 				}
 
+                                /* Stay on same filesystem */
+                                if (st_dev != st.st_dev)
+                                {
+                                        continue;
+                                }
+
 				int type = st.st_mode & S_IFMT;
 				if(type == S_IFREG || type == S_IFLNK)
 				{