BackupPC-users

[BackupPC-users] Sub directories of modules impossible?

2009-08-23 17:03:53
Subject: [BackupPC-users] Sub directories of modules impossible?
From: chin <cle-backuppc AT qiao.in-berlin DOT de>
To: backuppc-users AT lists.sourceforge DOT net
Date: Sun, 23 Aug 2009 22:23:09 +0200
Hello,

I had success in installing BackupPC 3.2.0beta0 on NetBSD 5.0 using this 
as my backup server for some Windows PCs and some Apple computer in my 
family network.

To backup my Apple, I had chosen to use the rsyncd as my XferMethod. My 
intention was to define a module like e.g. that on my Apple's rsyncd.conf:

:
[cle]
   path = /Users/cle
:

This would potentially open my whole home directory for backup purposes. 
But I am only interested in some sub directories of my home one, for 
instance: /Users/cle/Documents.

To achieve this, I tried to define (via Web interface) a configuration 
for said Apple computer, that would set

   RsyncShareName = cle/Documents

This syntax is allowed for rsyncd meaning, that the first word would be 
interpreted as the module's name.

Unfortunately, BackupPC seems not to be able to deal with sub 
directories of modules.

I have dug in the mailing list archives on SourceForge and in the 
documentation. But it seems that topic never popped up in the past. But 
-- of course -- it is as well possible, that I used the wrong keywords 
for my search. I apologize if that was the case.

I would now like to ask, if it is possible to introduce the feature to 
backup sub directories of modules? I have tried to patch the source, 
i.e. the file lib/BackupPC/Xfer/Rsync.pm. My patch seem to solve my 
problem for me, but of course, I cannot be 100% sure, that it will not 
break something at another place, as I did not try every protocol and 
every function of BackupPC. Just in case you would like to have a look 
at my patch, here it is:

======================8X===========================
--- Rsync.pm.orig       2009-08-23 13:28:54.000000000 +0200
+++ Rsync.pm    2009-08-23 22:22:06.000000000 +0200
@@ -390,11 +390,16 @@
             return;
         }
         #
-       # Pass module name, and follow it with a slash if it already
-       # contains a slash; otherwise just keep the plain module name.
+       # Try to split module into module name and a path component.
+       # Remove any trailing slash if available. Reset the remote
+       # dir for then daemon to the path component, if necessary.
         #
         my $module = $t->{shareName};
-       $module = $t->{shareNameSlash} if ( $module =~ /\// );
+       if ($module =~ m(^([^/]+)/(.*)/*$)) {
+           $module = $1;
+           $remoteDirDaemon = $2 if $2;
+       }
+
          from_to($module, "utf8", $conf->{ClientCharset})
                                      if ( $conf->{ClientCharset} ne "" );
         if ( defined(my $err = $rs->serverService($module,
======================8X===========================

Let me apologize in advance, if this list is the wrong one rendering me 
off topic ...

Let me thank you, for the nice tool.


Best regards,
chin :-)

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
BackupPC-users mailing list
BackupPC-users AT lists.sourceforge DOT net
List:    https://lists.sourceforge.net/lists/listinfo/backuppc-users
Wiki:    http://backuppc.wiki.sourceforge.net
Project: http://backuppc.sourceforge.net/