BackupPC-users

Re: [BackupPC-users] archive problem

2008-08-01 13:48:53
Subject: Re: [BackupPC-users] archive problem
From: "Jeff Rippy" <jrippy AT gmail DOT com>
To: "Les Mikesell" <lesmikesell AT gmail DOT com>
Date: Fri, 1 Aug 2008 12:48:46 -0500
yes I had thought of that too and have already added the backuppc user to the "tape" group.  permissions are 660 or rw-rw---- with owner root and group tape.  Also the backuppc documentation and even the default configuration uses /dev/st0 so why exactly do you recommend /dev/nst0 instead.  Shouldn't backuppc be controlling where it writes to the tape?
I think the problem has something to do with what Holger was saying, for some reason the script is trying to create /dev/st0 even though its already there.
Here is an excerpt from the script that I think is relevant but I haven't been able to find information on the sh or dash or bash (whichever it is) switches that are being used here: (Lines 107-129 from /usr/share/backuppc/bin/BackupPC_archiveHost - specifically look at 109 where it checks for something (again not sure what the switches do) and 116 where it tries to create the output location)

    107 my $cmd = "$tarCreate -t -h $host -n $bkupNum -s $share . ";
    108 $cmd   .= "| $compPath " if ( $compPath ne "cat" && $compPath ne "" );
    109 if ( -b $outLoc || -c $outLoc || -f $outLoc ) {
    110     #
    111     # Output file is a device or a regular file, so don't use split
    112     #
    113     $cmd  .= ">> $outLoc";
    114     $mesg .= " to $outLoc";
    115 } else {
    116     mkpath($outLoc) if ( !-d $outLoc );
    117     if ( !-d $outLoc ) {
    118         print("Error: unable to create output directory $outLoc\n");
    119         exit(1);
    120     }
    121     if ( $splitSize > 0 && -x $splitPath ) {
    122         $cmd  .= "| $splitPath -b $splitSize - $outLoc/$host.$bkupNum.tar$fileExt.";
    123         $mesg .= ", split to output files $outLoc/$host.$bkupNum.tar$fileExt.*";
    124     } else {
    125         $cmd  .= "> $outLoc/$host.$bkupNum.tar$fileExt";
    126         $mesg .= " to output file $outLoc/$host.$bkupNum.tar$fileExt";
    127     }
    128 }
    129 print("$mesg\n");


On Thu, Jul 31, 2008 at 12:10 PM, Les Mikesell <lesmikesell AT gmail DOT com> wrote:
Jeff Rippy wrote:
Thanks for the quick reply.  The backuppc user uses /bin/sh not bash.  sh is a symbolic link to /bin/dash it looks like.  Not sure if this helps or not.

The shell doesn't have much to do with this except possibly giving you the wrong error message.  The real problem is almost certainly that the backuppc user doesn't have write permission on /dev/st0 (and if you are ever going to write more than one run to a tape you might want to use /dev/nst0 instead).

I'm not sure how Ubuntu handles the setup, but udev-based systems rebuild the device nodes on the fly so if you just change owner/group/permissions, you have to do it after every reboot.  If it is group rw you can add the backuppc user to it's group.  Otherwise you'll have to add a udev rule or something to control it.

--
 Les Mikesell
   lesmikesell AT gmail DOT com


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
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/