On 2011-07-19 12:12, Dave Howorth wrote:
Dave Howorth wrote:
I finally managed to find my bug. It'll be a couple of days whilst I
check that it at least seems to really work in my installation and then
I'll post it.
OK. It seems to work. On appropriate occasions, it produces messages like:
cannot expire pcx36-root:default:2011-07-13 It's the latest good image
I've attached the modified dirvish-expire to this message and here's a
diff from the previous version (caveat! The previous version may or may
not be exactly what I originally downloaded!)
hi!
This patch was made after applying your diff on Debian.
Just fort convenience:)
tamas
--- dirvish-expire.orig 2008-03-08 20:07:34.000000000 +0100
+++ dirvish-expire 2011-07-19 12:50:43.045125994 +0200
@@ -109,6 +109,7 @@
$$Options{time} and $expire_time = parsedate($$Options{time});
$expire_time ||= time;
+my %recent;
if ($$Options{vault})
{
@@ -151,6 +152,20 @@
($created = $$expire{created}) =~ s/:\d\d$//;
($expired = $$expire{expire}) =~ s/:\d\d$//;
+ my $vault = $$expire{vault};
+ my $branch = $$expire{branch};
+
+ if ($recent{$vault}{$branch} eq $created)
+ {
+ printf "cannot expire %s:%s:%s It's the latest good image\n",
+ $vault,
+ $branch,
+ $$expire{image};
+ ++$unexpired{$vault}{$branch};
+ next;
+ }
+
+
if (!$unexpired{$$expire{vault}}{$$expire{branch}})
{
printf "cannot expire %s:%s:%s No unexpired good images\n",
@@ -224,6 +239,20 @@
$$summary{vault} && $$summary{branch} && $$summary{Image}
or return;
+ my ($vault, $branch, $success, $created, $recent);
+
+ $vault = $$summary{vault};
+ $branch = $$summary{branch};
+ $success = $$summary{Status} =~ /^success/ && -d ($path . '/tree');
+ ($created = $$summary{'Backup-complete'}) =~ s/:\d\d$//;
+ $recent = $recent{$vault}{$branch};
+
+ if ($success and (!defined($recent) or $recent lt $created))
+ {
+ $recent{$vault}{$branch} = $created;
+ }
+
+
if ($status == 0)
{
$$summary{Status} =~ /^success/ && -d ($path . '/tree')
_______________________________________________
Dirvish mailing list
[email protected]
http://www.dirvish.org/mailman/listinfo/dirvish