/[BackupPC]/trunk/bin/BackupPC_tarIncCreate
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_tarIncCreate

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

revision 261 by dpavlin, Mon Dec 12 21:11:17 2005 UTC revision 329 by dpavlin, Tue Jan 31 22:04:47 2006 UTC
# Line 160  my $dbh = DBI->connect($dsn, $db_user, " Line 160  my $dbh = DBI->connect($dsn, $db_user, "
160  my $sth_inc_size = $dbh->prepare(qq{  my $sth_inc_size = $dbh->prepare(qq{
161          update backups set          update backups set
162                  inc_size = ?,                  inc_size = ?,
                 parts = ?,  
163                  inc_deleted = false                  inc_deleted = false
164          where id = ?          where id = ?
165  });  });
# Line 252  sub new_tar_part { Line 251  sub new_tar_part {
251          if ($fh) {          if ($fh) {
252                  return if ($current_tar_size == 0);                  return if ($current_tar_size == 0);
253    
254                  print STDERR " $part";                  print STDERR "\n\t+ $part:";
255    
256                  #                  #
257                  # Finish with two null 512 byte headers,                  # Finish with two null 512 byte headers,
# Line 271  sub new_tar_part { Line 270  sub new_tar_part {
270    
271                  my $size = (stat( $file . '.tar.gz' ))[7] || die "can't stat ${file}.tar.gz";                  my $size = (stat( $file . '.tar.gz' ))[7] || die "can't stat ${file}.tar.gz";
272    
273                    print "$file, $size bytes, $items_in_part items";
274    
275                  $sth_backup_parts->execute(                  $sth_backup_parts->execute(
276                          $backup_id,                          $backup_id,
277                          $part,                          $part,
# Line 308  sub new_tar_part { Line 309  sub new_tar_part {
309    
310                          $sth_inc_size->execute(                          $sth_inc_size->execute(
311                                  $total_increment_size,                                  $total_increment_size,
                                 $part,  
312                                  $backup_id                                  $backup_id
313                          );                          );
314    
315                          print STDERR ", $total_increment_size bytes\n" if ($opts{v});                          print "\n\ttotal $total_increment_size bytes";
316    
317                          return;                          return;
318                  }                  }
# Line 331  sub new_tar_part { Line 331  sub new_tar_part {
331                  mkdir($tar_path) || die "can't create directory $tar_path: $!";                  mkdir($tar_path) || die "can't create directory $tar_path: $!";
332    
333                  sub abort_cleanup {                  sub abort_cleanup {
334                          print STDERR "ABORTED: cleanup temp dir";                          print STDERR "ABORTED: cleanup temp dir ";
335                          rmtree($tar_path);                          rmtree($tar_path);
336                          $dbh->rollback;                          $dbh->rollback;
337                          exit 1;                          exit 1;
# Line 374  if (seedCache($Host, $ShareName, $Num)) Line 374  if (seedCache($Host, $ShareName, $Num))
374          print STDERR "NOTE: no files found for $Host:$ShareName, increment $Num\n" if ($opts{v});          print STDERR "NOTE: no files found for $Host:$ShareName, increment $Num\n" if ($opts{v});
375          # remove temporary files if there are no files          # remove temporary files if there are no files
376          rmtree($tar_path);          rmtree($tar_path);
377    
378            my $sth = $dbh->prepare(qq{
379                    update backups set inc_size = 0, inc_deleted = true
380                    where id = ?
381            });
382            $sth->execute($backup_id);
383    
384  }  }
385    
386  #  #

Legend:
Removed from v.261  
changed lines
  Added in v.329

  ViewVC Help
Powered by ViewVC 1.1.26