Morning folks... I'm trying to use a script to run a dump of all
filesystems, but whenever I use the -L option, I receive an error as
follows for every mount:


DUMP: Date of this level 0 dump: Mon Sep  1 13:37:57 2008
  DUMP: Date of last level 0 dump: the epoch
  DUMP: Dumping snapshot of /dev/da0s1a (/) to standard output
  DUMP: mapping (Pass I) [regular files]
  DUMP: mapping (Pass II) [directories]
  DUMP: estimated 329257 tape blocks.
  DUMP: dumping (Pass III) [directories]
  DUMP: dumping (Pass IV) [regular files]
  DUMP: DUMP: 329274 tape blocks
  DUMP: finished in 91 seconds, throughput 3618 KBytes/sec
  DUMP: level 0 dump on Mon Sep  1 13:37:57 2008
  DUMP: DUMP IS DONE
mksnap_ffs: Cannot create /home/.snap/dump_snapshot: Input/output error
dump: Cannot create /home/.snap/dump_snapshot: No such file or directory

  DUMP: Date of this level 0 dump: Mon Sep  1 13:39:33 2008
  DUMP: Date of last level 0 dump: the epoch
  DUMP: Dumping snapshot of /dev/da0s1e (/usr) to standard output
  DUMP: mapping (Pass I) [regular files]
  DUMP: mapping (Pass II) [directories]
  DUMP: estimated 4758000 tape blocks.
  DUMP: dumping (Pass III) [directories]
mksnap_ffs: Cannot create /home/.snap/dump_snapshot: Input/output error
dump: Cannot create /home/.snap/dump_snapshot: No such file or directory


I've inspected the locations reported, and can confirm that
.snap/dump_snapshot exists in the required locations on every mount, and
shows as being created at the time the dump was run as follows:


bigsis# pwd
/home/.snap
bigsis# ls -ltra
total 4
drwx--x--x  11 root  wheel     512 Mar 25 03:05 ..
-r--------   1 root  operator    0 Sep  1 13:32 fsck_snapshot
-r--------   1 root  operator    0 Sep  1 13:39 dump_snapshot
drwxrwx---   2 root  operator  512 Sep  1 13:39 .


The script I'm using is a perl script as follows, and is called by
root's crontab:

#!/usr/bin/perl
use strict;
use warnings;
use Getopt::Std;
use POSIX qw(strftime);
use vars qw($VERSION);

$Getopt::Std::STANDARD_HELP_VERSION = 1;
$VERSION = '1.2';

my @FS = ('/', '/home', '/usr', '/var');
my $day = lc(strftime "%A", localtime);
my $hostname = `/bin/hostname -s`;
my %opt = ('F' => 0, 'd' => 0, 'h' => 0);
my $type;

chomp $hostname;

getopts("Fdh",\%opt);

if ( $opt{h} == 1 ) {

        print STDERR << "EOF";

    usage: $0 [-hqd]

     -h        : this (help) message
     -d        : Dry run, only print what I am going to do
     -F        : Force full backup {type 0}

    example: $0 -h -q -d

EOF
        exit(0)
}

if ( $opt{F} == 1 ) {

        $type = "0"

} else {

        if ($day eq "sunday") {
                $type = "0"
        } else {
                $type = "0"
        }

}

foreach (@FS) {

        my $name = $_;

        if ($name eq '/') {
                $name = '/root';
        };

        $name =~ s/^\///g;

# Unncomment for /backup/$day/$name.dump.gz
        my $command = '/sbin/dump -' . $type  . ' -aLuf - ' .  $_ . ' |
gzip -q > /backup/' . $day . '/' .
$name . '.dump.gz';

# Put a "#" in front of the next line if you uncomment the last line
#       my $command = '/sbin/dump -' . $type  . ' -aLuf - ' .  $_ . ' |
gzip -q > /backup/' . $hostname .
'/' . $day . '.' . $name . '.dump.gz';

        if ($opt{d}) {
                print($command . "\n");
        } else {
                system($command);
        };
};


exit(0);


Any suggestions??? All works fine if I don't use -L, but this isn't
exactly ideal for a backup of a live file-system...

Marc A Coyles - Horbury School ICT Support Team
Mbl: 07850 518106
Land: 01924 282740 ext 730
Helpdesk: 01924 282740 ext 2000
 


_______________________________________________
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to