~ubuntu-branches/debian/squeeze/sympa/squeeze

« back to all changes in this revision

Viewing changes to src/etc/script/arcrepair.pl

  • Committer: Bazaar Package Importer
  • Author(s): Stefan Hornburg (Racke)
  • Date: 2005-04-09 23:33:35 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20050409233335-fm1lfafyokbq4bsx
Tags: 4.1.5-2

* added /etc/mail to directory list (Closes: #298404, thanks to Massimo
  Cetra <mcetra@navynet.it> for the report)
* fixed typo in package description (Closes: #300038, thanks to Florian
  Zumbiehl <florz@gmx.de> for the report) 

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#! /usr/bin/perl
 
2
 
 
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)
 
7
 
 
8
unless ($#ARGV >= 0) {
 
9
    die "Usage: $0 <path_to_outgoing_dir> <path_to_web_archives>";
 
10
}
 
11
 
 
12
my $outgoing = $ARGV[0];
 
13
my $arc_path = $ARGV[1];
 
14
 
 
15
unless (-d $outgoing) {
 
16
    die "Missing directory $outgoing";
 
17
}
 
18
 
 
19
unless (-d $arc_path) {
 
20
    die "Missing directory $arc_path";
 
21
}
 
22
 
 
23
opendir(DIR, $arc_path);
 
24
my @files =  (grep(!/^\.{1,2}$/, readdir DIR ));
 
25
 
 
26
my $i = 0;
 
27
 
 
28
foreach my $d1 (@files) {
 
29
    if ($d1 =~ /\.(\d+)$/) {
 
30
        my $f1 = "$arc_path/$d1/1970-01/arctxt/1";
 
31
        unless (-f $f1) {
 
32
            die "Could not find $f1";
 
33
            next;
 
34
        }
 
35
        print "Moving $f1 to $outgoing/$d1.$i\n";
 
36
        rename $f1, "$outgoing/$d1.$i";      
 
37
        $i++;
 
38
        `rm -rf $arc_path/$d1`;
 
39
    }
 
40
}
 
41
closedir DIR;