+ my(@deferUserQueue, @deferBgQueue);
+ my $du;
+
+ if ( time - $Info{DUlastValueTime} >= 600 ) {
+ #
+ # Update our notion of disk usage no more than
+ # once every 10 minutes
+ #
+ $du = $bpc->CheckFileSystemUsage($TopDir);
+ $Info{DUlastValue} = $du;
+ $Info{DUlastValueTime} = time;
+ } else {
+ #
+ # if we recently checked it then just use the old value
+ #
+ $du = $Info{DUlastValue};
+ }
+ if ( $Info{DUDailyMaxReset} ) {
+ $Info{DUDailyMaxStartTime} = time;
+ $Info{DUDailyMaxReset} = 0;
+ $Info{DUDailyMax} = 0;
+ }
+ if ( $du > $Info{DUDailyMax} ) {
+ $Info{DUDailyMax} = $du;
+ $Info{DUDailyMaxTime} = time;
+ }
+ if ( $du > $Conf{DfMaxUsagePct} ) {
+ my @bgQueue = @BgQueue;
+ my $nSkip = 0;
+
+ #
+ # When the disk is too full, only run backups that will
+ # do expires, not regular backups
+ #
+ @BgQueue = ();
+ foreach $req ( @bgQueue ) {
+ if ( $req->{dumpExpire} ) {
+ unshift(@BgQueue, $req);
+ } else {
+ $BgQueueOn{$req->{host}} = 0;
+ $nSkip++;
+ }
+ }
+ if ( $nSkip ) {
+ print(LOG $bpc->timeStamp,
+ "Disk too full ($du%); skipped $nSkip hosts\n");
+ $Info{DUDailySkipHostCnt} += $nSkip;
+ }
+ }
+