/[BackupPC]/trunk/bin/BackupPC_updatedb
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/bin/BackupPC_updatedb

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 49 by dpavlin, Sat Aug 20 15:01:48 2005 UTC revision 50 by dpavlin, Sat Aug 20 15:51:16 2005 UTC
# Line 198  INSERT INTO files Line 198  INSERT INTO files
198          VALUES (?,?,?,?,?,?,?,?)          VALUES (?,?,?,?,?,?,?,?)
199  });  });
200    
201    sub fmt_time {
202            my $t = shift || return;
203            my $out = "";
204            my ($ss,$mm,$hh) = gmtime($t);
205            $out .= "${hh}h" if ($hh);
206            $out .= sprintf("%02d:%02d", $mm,$ss);
207            return $out;
208    }
209    
210  foreach my $host_key (keys %{$hosts}) {  foreach my $host_key (keys %{$hosts}) {
211    
212          my $hostname = $hosts->{$host_key}->{'host'} || die "can't find host for $host_key";          my $hostname = $hosts->{$host_key}->{'host'} || die "can't find host for $host_key";
# Line 255  foreach my $host_key (keys %{$hosts}) { Line 264  foreach my $host_key (keys %{$hosts}) {
264                          $shareID = getShareID($share, $hostID, $hostname);                          $shareID = getShareID($share, $hostID, $hostname);
265                                    
266                          my ($f, $nf, $d, $nd) = recurseDir($bpc, $hostname, $files, $backupNum, $share, "", $shareID);                          my ($f, $nf, $d, $nd) = recurseDir($bpc, $hostname, $files, $backupNum, $share, "", $shareID);
267                          printf(" %d/%d files %d/%d dirs [%.2f/s]\n",                          my $dur = (time() - $t) || 1;
268                            printf(" %d/%d files %d/%d dirs [%.2f/s dur: %s]\n",
269                                  $nf, $f, $nd, $d,                                  $nf, $f, $nd, $d,
270                                  ( ($f+$d) / ((time() - $t) || 1) )                                  ( ($f+$d) / $dur ),
271                                    fmt_time($dur)
272                          );                          );
273                          $dbh->commit();                          $dbh->commit();
274                  }                  }

Legend:
Removed from v.49  
changed lines
  Added in v.50

  ViewVC Help
Powered by ViewVC 1.1.26