September 2000
Beginner
408 pages
10h 29m
English
batchreconstruct is a Perl script that runs the Cyrus reconstruct command on each newly created Cyrus mailbox. It takes a filename or a list of usernames as input. The batchreconstruct script is shown in Example A-6 .
Example A-6. batchreconstruct
#!/usr/local/bin/perl
chop ($whoami = \Q/usr/ucb/whoami\Q);
if ($whoami ne "cyrus" ) {
die "You must be cyrus to run this script!\\n";
}
$cmd = "/usr/cyrus/bin/reconstruct -r";
$users = "$ARGV[0]";
if (!$users) { die "Usage: $0 input_file\\n"; }
open(MB,"$users") || die "can't open $users";
while (<MB>) {
chop;
system("$cmd user.$_");
}
close MB;