/[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 37 by dpavlin, Fri Aug 19 14:57:30 2005 UTC revision 38 by dpavlin, Fri Aug 19 15:27:27 2005 UTC
# Line 8  use BackupPC::View; Line 8  use BackupPC::View;
8  use Data::Dumper;  use Data::Dumper;
9  use Getopt::Std;  use Getopt::Std;
10  use Time::HiRes qw/time/;  use Time::HiRes qw/time/;
11    use File::Pid;
12  use POSIX qw/strftime/;  use POSIX qw/strftime/;
13  use constant BPC_FTYPE_DIR => 5;  use constant BPC_FTYPE_DIR => 5;
14    
15  my $debug = 0;  my $debug = 0;
16  $|=1;  $|=1;
17    
18    my $pidfile = new File::Pid;
19    
20    if (my $pid = $pidfile->running ) {
21            die "$0 already running: $pid\n";
22    } elsif ($pidfile->pid ne $$) {
23            $pidfile->remove;
24            $pidfile = new File::Pid;
25            $pidfile->write;
26            print STDERR "$0 using pid ",$pidfile->pid," file ",$pidfile->file,"\n";
27    }
28    
29  my $t_fmt = '%Y-%m-%d %H:%M:%S';  my $t_fmt = '%Y-%m-%d %H:%M:%S';
30    
31  my $hosts;  my $hosts;
# Line 232  undef $sth; Line 244  undef $sth;
244  $dbh->commit();  $dbh->commit();
245  $dbh->disconnect();  $dbh->disconnect();
246    
247    $pidfile->remove;
248    
249  sub getShareID() {  sub getShareID() {
250    
251          my ($share, $hostID, $hostname) = @_;          my ($share, $hostID, $hostname) = @_;

Legend:
Removed from v.37  
changed lines
  Added in v.38

  ViewVC Help
Powered by ViewVC 1.1.26