BackupPC-users

Re: [BackupPC-users] Noob questions

2009-05-22 16:20:52
Subject: Re: [BackupPC-users] Noob questions
From: "Jeffrey J. Kosowsky" <backuppc AT kosowsky DOT org>
To: "General list for user discussion, questions and support" <backuppc-users AT lists.sourceforge DOT net>
Date: Fri, 22 May 2009 16:17:06 -0400
Daniel Carrera wrote at about 21:19:47 +0200 on Friday, May 22, 2009:
 > Hi Les,
 > 
 > Thanks for the help. Comments below.
 > 
 > > It doesn't have a concept of it's archive directory being 
 > > gone, though.  You'll probably have to start and stop the service when 
 > > you connect/remove it.
 > 
 > Would it be difficult to add this feature? I imagine that I'm not the 
 > first person to try to use an external disk as a backup medium. But it 
 > is the nature of an external disk that it might not be connected.
 > 
 > If I had to start/stop the service every time I connect, I'd probably 
 > get tired. I don't think that this is a long term solution. Perhaps it's 
 > possible to add something similar to:
 > 
 > if ( ! -d $Conf{TopDir} ) {
 >      print (LOG $bpc->timeStamp, "No backup medium\n");
 >      exit(1);
 > }

Couple of comments and suggestions:
1. This code probably needs to occur several places in the main
   'while' loop in /usr/share/BackupPC/bin/BackupPC
   To be absolutely careful, you would want to put it before every
   action that could take some time to execute. e.g.,
                  Before: Main_TryToRun_nightly()
                  Before: Main_TryToRun_CmdQueue()
                  Before: Main_TryToRun_Bg_or_User_Queue()
                  Before: Main_Check_Timeout()

2. Rather than using 'exit(1)', why not use 'next'. This way you don't
   have to restart BackupPC every time you remount the external
   disk. You will get the error message about once an hour in your log
   each time the select function times out

3. You also should add that test to the initialization section though
   there you do want to use 'exit'. I made a similar addition to
   the Main_Initialize subroutine just before the HardLinkTest
   statement.

 > Looks like a simple and generally useful addition. Is there any chance 
 > that this might be added to BackupPC?

I wouldn't hard-wire that in because people might want different
behaviors. If you look back in the archive, you will notice that  I
required similar behavior to check for a volume nfs mounted on another
server and to try to remount it if it is not mounted.

If Craig is interested in adding this capability, my suggestion
instead would be to make it configurable by adding it to the config.pl
file as commands analogous to DumpPreUserCmd.  You would probably need
two: one for the initialization subroutine and one to run during the
main while loop.

 > 
 > Daniel.
 > 
 > ------------------------------------------------------------------------------
 > Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT
 > is a gathering of tech-side developers & brand creativity professionals. Meet
 > the minds behind Google Creative Lab, Visual Complexity, Processing, & 
 > iPhoneDevCamp asthey present alongside digital heavyweights like Barbarian
 > Group, R/GA, & Big Spaceship. http://www.creativitycat.com 
 > _______________________________________________
 > 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/
 > 

------------------------------------------------------------------------------
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT
is a gathering of tech-side developers & brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing, & 
iPhoneDevCamp asthey present alongside digital heavyweights like Barbarian
Group, R/GA, & Big Spaceship. http://www.creativitycat.com 
_______________________________________________
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/