#!/usr/local/bin/perl use strict; $|++; use vars qw( $LOGDIR $TESTING $TAPEPATH $DISKPATH %DRIVES $DUMP $REMOTE ); do '/etc/ufsdump.config' or die "No/bad /etc/ufsdump.config\n"; foreach my $drive (sort keys %DRIVES) { my $base = $drive; $base =~ s%^(.*)/([^/]*)%$2%; my $time = sprintf("%04d-%02d-%02d", (localtime)[5] + 1900, (localtime)[4] + 1, (localtime)[3]); my $log = "$LOGDIR/$drive.0.$time"; my $string = ""; if ($REMOTE) { # Dumps are going to a remote tape drive $string = "$DUMP 0afun $log - $DRIVES{$drive} $REMOTE"; } elsif ($TAPEPATH) { # Dumps are going to a local file $string = "$DUMP 0bafunc 512 $log $TAPEPATH $DRIVES{$drive}"; } else { # Nothing is defined die "No defined place to put level 0 backups\n"; } print "$string\n"; system("$string") unless $TESTING; }