/[psinib]/psinib.pl
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 /psinib.pl

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

revision 1.12 by dpavlin, Sun Oct 12 16:13:38 2003 UTC revision 1.13 by dpavlin, Sun Oct 12 17:44:21 2003 UTC
# Line 33  my $LOG = '/var/log/backup.log';       # add p Line 33  my $LOG = '/var/log/backup.log';       # add p
33  #$LOG = '/tmp/backup.log';  #$LOG = '/tmp/backup.log';
34    
35  # store backups in which directory  # store backups in which directory
36  #my $BACKUP_DEST = '/backup/isis_backup';  my $BACKUP_DEST = '/backup/isis_backup';
37  my $BACKUP_DEST = '/tmp/backup/';  #my $BACKUP_DEST = '/tmp/backup/';
38    
39  # files to ignore in backup  # files to ignore in backup
40  my @ignore = ('.md5sum', '.backupignore', 'backupignore.txt');  my @ignore = ('.md5sum', '.backupignore', 'backupignore.txt');
# Line 259  sub snap_share { Line 259  sub snap_share {
259          my %file_atime;          my %file_atime;
260          my %file_mtime;          my %file_mtime;
261          #my %file_md5;          #my %file_md5;
262            %file_md5 = ();
263    
264          my @smb_files;          my @smb_files;
265          my %smb_size;          my %smb_size;
# Line 490  sub snap_share { Line 491  sub snap_share {
491          # remove files          # remove files
492          foreach (sort @files2erase) {          foreach (sort @files2erase) {
493                  unlink "$bc/$_" || warn "unlink $_: $!\n";                  unlink "$bc/$_" || warn "unlink $_: $!\n";
494                    delete $file_md5{$_};
495          }          }
496    
497          # remove not needed dirs (after files)          # remove not needed dirs (after files)
# Line 502  sub snap_share { Line 504  sub snap_share {
504                  unlink "$bc/$_/.md5sum" if (-e "$bc/$_/.md5sum");                  unlink "$bc/$_/.md5sum" if (-e "$bc/$_/.md5sum");
505          }          }
506    
507            # erase stale entries in .md5sum
508            my @md5_files = keys %file_md5;
509            $lc = List::Compare->new(\@md5_files, \@smb_files);
510            foreach my $file ($lc->get_Lonly) {
511                    xlog("NOTICE","removing stale '$file' from .md5sum");
512                    delete $file_md5{$file};
513            }
514    
515          # create .md5sum          # create .md5sum
516          my $last_dir = '';          my $last_dir = '';
517          my $md5;          my $md5;

Legend:
Removed from v.1.12  
changed lines
  Added in v.1.13

  ViewVC Help
Powered by ViewVC 1.1.26