[Zetaback-devel] [zetaback commit] r167 - trunk
svn-commit at lists.omniti.com
svn-commit at lists.omniti.com
Fri Jan 22 15:40:26 EST 2010
Author: mark
Date: 2010-01-22 15:40:25 -0500 (Fri, 22 Jan 2010)
New Revision: 167
Modified:
trunk/zetaback.in
Log:
Only create the store directories when needed instead of every time the store is looked up
Modified: trunk/zetaback.in
===================================================================
--- trunk/zetaback.in 2010-01-22 19:43:12 UTC (rev 166)
+++ trunk/zetaback.in 2010-01-22 20:40:25 UTC (rev 167)
@@ -514,7 +514,6 @@
my ($host, $class) = @_;
my $store = config_get($host, 'store', $class);
$store =~ s/%h/$host/g;;
- mkpath($store) if(! -d $store);
return $store;
}
@@ -576,6 +575,7 @@
print "Acquiring lock for $host:$file\n" if($DEBUG);
$file ||= 'master.lock';
my $store = get_store($host); # Don't take classes into account - not needed
+ mkpath($store) if(! -d $store);
return 1 if(exists($locks{"$host:$file"}));
open(LOCK, "+>>$store/$file") || return 0;
unless(flock(LOCK, LOCK_EX | ($nowait ? LOCK_NB : 0))) {
@@ -590,6 +590,7 @@
print "Releasing lock for $host:$file\n" if($DEBUG);
$file ||= 'master.lock';
my $store = get_store($host); # Don't take classes into account - not needed
+ mkpath($store) if(! -d $store);
return 0 unless(exists($locks{"$host:$file"}));
*UNLOCK = $locks{$file};
unlink("$store/$file") if($remove);
@@ -1371,6 +1372,7 @@
print " => Scanning '$store' for old backups of '$diskname'.\n" if($DEBUG);
# Make directory on demand
+ mkpath($store) if(! -d $store);
my $backup_info = scan_for_backups($store);
# That gave us info on all backups, we just want this disk
$backup_info = $backup_info->{$diskname} || {};
More information about the Zetaback-devel
mailing list