--- smeserver-affa-1.0.0/root/sbin/e-smith/affa.bug4210 2008-04-04 15:15:07.000000000 +0200 +++ smeserver-affa-1.0.0/root/sbin/e-smith/affa 2008-04-22 09:03:02.000000000 +0200 @@ -38,7 +38,7 @@ $ENV{LANG} = "en_US"; # Filesys::DiskFree only works with english LANG setting -my $VERSION='0.10.0-1'; +my $VERSION='1.0.0-1'; # sub prototypes @@ -540,6 +540,11 @@ shiftArchives(); putDoneDates( $jobname ); +updateReportDB(); +execPostJobCommand(0); +emptyTrash(); +DiskSpaceWarn(); +sendSuccessMesssage(); affaExit( "Completed job $jobname $Command ($job{'remoteHostName'})" ); exit 0; ############################################################################ @@ -650,7 +655,7 @@ } else { - lg('Warning: DNS resolver timeout'); + dbg("Warning: DNS resolver timeout for $job{'remoteHostName'} ($jobname)"); } } # check for remoteHostName==localhost using e-smith DB @@ -1019,7 +1024,7 @@ my $res=''; while( defined ($ar=readdir(DIR)) ) { - next if not $ar =~ /^(scheduled|hourly|daily|weekly|monthly|yearly])\.[0-9]+$/; + next if not $ar =~ /^(scheduled|daily|weekly|monthly|yearly])\.[0-9]+$/; if( -f "$job{'RootDir'}/$jobname/$ar/.AFFA-REPORT" ) { open( AS, "<$job{'RootDir'}/$jobname/$ar/.AFFA-REPORT" ); @@ -1150,7 +1155,7 @@ my $archive; while( defined ($archive=readdir(DIR)) ) { - next if not $archive =~ /^(scheduled|hourly|daily|weekly|monthly|yearly])\.[0-9]+$/; + next if not $archive =~ /^(scheduled|daily|weekly|monthly|yearly])\.[0-9]+$/; my $report = $affareport->new_record($archive); $report->set_prop('type','affabackup'); $report->set_prop('RootDir',"$job{'RootDir'}/$jobname/$archive/"); @@ -1191,7 +1196,7 @@ sub execPreJobCommand() { - return if not $job{'preJobCommand'}; + return if not $jobname or $Command ne "scheduled" or not $job{'preJobCommand'}; lg( "Executing preJobCommand $job{'preJobCommand'}"); affaErrorExit( "Couldn't execute preJobCommand $job{'preJobCommand'}") if not -x $job{'preJobCommand'}; my @cmd = ( $job{'preJobCommand'}, $job{'remoteHostName'}, $jobname, $Command ); @@ -1200,7 +1205,7 @@ sub execPostJobCommand($) { - return if not $job{'postJobCommand'}; + return if not $jobname or $Command ne "scheduled" or not $job{'postJobCommand'}; lg( "Executing postJobCommand $job{'postJobCommand'}"); affaErrorExit( "Couldn't execute postJobCommand $job{'postJobCommand'}") if not -x $job{'postJobCommand'}; my @cmd = ( $job{'postJobCommand'}, $job{'remoteHostName'}, $jobname, $Command, shift(@_) ); @@ -1628,7 +1633,7 @@ my %va; while( defined ($ar=readdir(DIR)) ) { - next if not $ar =~ /^(scheduled|hourly|daily|weekly|monthly|yearly])\.[0-9]+$/; + next if not $ar =~ /^(scheduled|daily|weekly|monthly|yearly])\.[0-9]+$/; if( -f "$rootDir/$jobname/$ar/.AFFA-REPORT" ) { open( AS, "<$rootDir/$jobname/$ar/.AFFA-REPORT" ); @@ -1666,7 +1671,7 @@ my $af; while( defined ($af=readdir(DIR)) ) { - next if not $af =~ /^(scheduled|hourly|daily|weekly|monthly|yearly])\.[0-9]+$/; + next if not $af =~ /^(scheduled|daily|weekly|monthly|yearly])\.[0-9]+$/; (my $k, my $b)=split(/\./, $af); next if( $b<$job{$k."Keep"} ); $k =~ s/scheduled/A/; $k =~ s/daily/B/; $k =~ s/weekly/C/; $k =~ s/monthly/D/; $k =~ s/yearly/E/; @@ -2981,12 +2986,7 @@ sub affaExit( $ ) { my $msg = shift(@_); - updateReportDB(); - emptyTrash(); - execPostJobCommand(0); - DiskSpaceWarn(); unmountAll(); - sendSuccessMesssage(); lg( $msg ); removeLock(); lg( "Exiting." );