3
## This script should be run on server where Sympa 4.1 has been running
4
## Sympa 4.1 included a bug that lead to incorrect archiving of messages
5
## This script will detect incorrectly archived messages and move them back
6
## in the archiving spool (outgoing)
9
die "Usage: $0 <path_to_outgoing_dir> <path_to_web_archives>";
12
my $outgoing = $ARGV[0];
13
my $arc_path = $ARGV[1];
15
unless (-d $outgoing) {
16
die "Missing directory $outgoing";
19
unless (-d $arc_path) {
20
die "Missing directory $arc_path";
23
opendir(DIR, $arc_path);
24
my @files = (grep(!/^\.{1,2}$/, readdir DIR ));
28
foreach my $d1 (@files) {
29
if ($d1 =~ /\.(\d+)$/) {
30
my $f1 = "$arc_path/$d1/1970-01/arctxt/1";
32
die "Could not find $f1";
35
print "Moving $f1 to $outgoing/$d1.$i\n";
36
rename $f1, "$outgoing/$d1.$i";
38
`rm -rf $arc_path/$d1`;