Hello,

I tried yesterday to implement a backup system on my new Debian Sarge server (so the flexbackup version is the Debian testing packet 1.2.1). I have to save ACL of my samba shares so, I have chosen to use flexbackup and star to make the job: a backup on an SDLT SCSI tape.

The backup operation was quite good so I decided to go further with a restoration test.
Then , I've faced two problems (perhaps bugs):
- ACL wasn't restored at all.
- Every GID/UID of directories where root/root (made the restoration with root account).


For the first problem, I've found that if the star acl support is implemented in flexbackup script, it's not implemented in the restoration part. So I had to add two lines in the script:

######################################################################
# Extract files (maybe a list) to current directory
######################################################################
sub extract_routine {

...

} elsif ($cfg::type eq 'star') {
        $cmd .= "$::path{star} -x ";
        if ($restore_files ne '') {
            $cmd .= "list=$newlist ";
        }
        $cmd .= "-p ";
        $cmd .= "$::star_fifo_flag ";
        $cmd .= "$::star_verb_flag ";
        $cmd .= "$::star_sparse_flag ";
        $cmd .= "H=$cfg::star_format "; <<----------------- This one was added
        $cmd .= "$::star_acl_flag "; <<-----------------This one was added
       $cmd .= "$::star_blocknum_flag ";
        $cmd .= "$::star_blk_flag ";
        $cmd .= "-B ";
        $cmd .= "file=-";

...
And it works OK ! I think that somebody forgot something for the extraction with star.


But my second problem wasn't solved by adding those lines. After a few tests and checks, I managed to understand that the bug comes from the way the archive is build up on backup. I believe that passing a list of files and directories directly to star (by the command find in a pipe) is responsible of my problem.
So, I've changed the code in the backup part in order to make star build it's own list of files to backup (just a * in the command line).
Here are my changes:


######################################################################
# Return command to backup a directory using star
######################################################################
sub backup_star {

   my $label = shift(@_);
   my $dir = shift(@_);
   my $title = shift(@_);
   my $level = shift(@_);
   my $remote = shift(@_);
   my $cmd = '';
   my @cmds;
   my $stamp = "$cfg::tmpdir/refdate.$PROCESS_ID";
   my $remove = '';

   if (defined($remote) and ($level != 0)) {
        my $time = &get_last_date($label, $level, 'numeric');
        $cmd = "$::path{touch} -t \"$time\" $stamp";
        push(@cmds, &maybe_remote_cmd($cmd, $remote));
        $remove .= " $stamp";
   } else {
        $stamp = &get_last_date($label, $level, 'filename');
   }

   $cmd = "cd \"$dir\" && ";
#    $cmd .= &file_list_cmd($dir, $stamp, 'newline', $level, $remote); <<---- 
We do not want to use find
#    $cmd .= "| "; <<--- So this pipe is not used

   $cmd .= "$::path{star} -c ";
#    $cmd .= "list=- "; <<--- star command line manipulation
   $cmd .= "-p ";
   $cmd .= "-l ";
#    $cmd .= "-D "; <<---- We want to descend in the directories so no -D option
   $cmd .= "-B ";
#    $cmd .= "-dirmode "; <<--- same for dirmode
   if ($cfg::label ne 'false') {
        $cmd .= "VOLHDR=\"$title\" ";
   }
   $cmd .= "H=$cfg::star_format ";
   $cmd .= "$::star_fifo_flag ";
   $cmd .= "$::star_acl_flag ";
   $cmd .= "$::star_verb_flag ";
   $cmd .= "$::star_sparse_flag ";
   $cmd .= "$::star_atime_flag ";
   $cmd .= "$::star_blocknum_flag ";
   $cmd .= "$::star_blk_flag ";
   $cmd .= "file=- ";
   $cmd .= "* $::z"; <<---------- We simply add a joker * in order to go 
through the set (flexbackup set).
...


With those changes in the script,all my backup/restore tests succeded... I hope this message helps people solving their problem of flexbackup use with star. But perhaps haven't you got the same problems and it is only a misconfiguration of something else ? Who knows ?

Médéric RIBREUX (medspx)



-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl
_______________________________________________
flexbackup-help mailing list
flexbackup-help@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flexbackup-help

Reply via email to