Re: keeping server populated with packages
"Bryan White" <[email protected]>
| Newsgroups | gmane.network.up2date.current.devel |
|---|---|
| Message-ID | <000901c22b54$d1f86780$cfc10d44@desktop> |
> How do you keep the latest packages on the server? What steps must I do
> to allow the clients to 'see' new packages on the server?
>
> For testing I just did a wget of an updates mirror.
>
> Is this stuff in a readme someplace that I missed?
I have this script for fetching updates and recreating the channels. This
script was just thrown together and will need customizing for your
installation but here it is:
---------------------------------------------
#!/usr/bin/perl
use strict;
my $basepath = '/big/mirrors';
my $baseurl =
'ftp://mirror.atlantic.net/pub/linux/redhat/updates.redhat.com';
my $currentout = '/root/current.out';
my $spec = <<END;
$basepath/RH70updates|$baseurl/7.0/en/os/i386/*|arcamax-i386-7.0
$basepath/RH71updates|$baseurl/7.1/en/os/i386/*|arcamax-i386-7.1
$basepath/RH72updates|$baseurl/7.2/en/os/i386/*|arcamax-i386-7.2
$basepath/RH73updates|$baseurl/7.3/en/os/i386/*|arcamax-i386-7.3
END
sub Fetch()
{
foreach my $specline (split "\n",$spec)
{
# print "Line: $specline\n";
(my $dir, my $url, my $channel) = split(/\|/, $specline);
# print "Dir: $dir; URL:$url;\n";
if($dir eq '') { next; }
-d $dir or die "Directory $dir does not exist";
print "Dir: $dir\n";
chdir $dir;
system("ncftpget $url");
}
}
sub CreateChannels()
{
system("service current stop");
unlink($currentout);
print "current channel creation log will be in $currentout\n";
foreach my $specline (split "\n",$spec)
{
(my $dir, my $url, my $channel) = split(/\|/, $specline);
print "Creating 'current' channel $channel\n";
system("cadmin -v create $channel >>$currentout 2>&1");
}
system("service current start");
}
sub Main()
{
Fetch();
CreateChannels();
}
Main();
0;