From 93efae407e03b97af4872e7c84a1d8a47ef5f391 Mon Sep 17 00:00:00 2001 From: Dobrica Pavlinusic Date: Sun, 30 Jan 2011 18:17:50 +0100 Subject: [PATCH] tranfer xferOK to detect errors and run cleanup this can be killall par2 or similar command or par dying on us --- bin/BackupPC_ASA_PostArchive_Update | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/bin/BackupPC_ASA_PostArchive_Update b/bin/BackupPC_ASA_PostArchive_Update index e3d022d..1dea094 100755 --- a/bin/BackupPC_ASA_PostArchive_Update +++ b/bin/BackupPC_ASA_PostArchive_Update @@ -38,6 +38,7 @@ my ($opt,$usage) = describe_options( "%c %o", [ 'host|h=s@', "import just host(s)" ], [ 'num|n=s@', "import just backup number(s)" ], +[ 'ok=n', "xferOK", { default => 0 } ], [ 'check|c', "check archives on disk and sync", { default => 1 } ], [ 'debug|d', "debug", { default => 1 } ], [ 'help', "show help" ], @@ -377,7 +378,15 @@ foreach ( 0 .. $#{ $opt->host } ) { my $host = $opt->host->[$_]; my $num = $opt->num->[$_]; - check_archive $host => $num; + if ( ! $opt->ok ) { + warn "ERROR $host $num running cleanup"; + foreach my $path ( glob "$Conf{ArchiveDest}/$host.$num.*" ) { + warn "# rm $path"; + unlink $path || die $!; + } + } else { + check_archive $host => $num; + } } -- 2.20.1