Re: Local repository

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 2005-04-22 at 14:05 +0200, Sasa Stupar wrote:
> --On 22. april 2005 12:16 +0200 Ralf Corsepius <rc040203@xxxxxxxxxx> wrote:
> 
> > On Fri, 2005-04-22 at 11:48 +0200, Sasa Stupar wrote:
> >> Hi!
> >>
> >> I am going to make local repository for fedora updates and extras and I
> >> am  wondering what is the best tool for it: rsync or wget.
> > It depends on the remote server you are trying to mirror.
> >
> > If it provides rsync-access, then rsync probably is the preferable
> > choice.
> >
> > If it doesn't provide rsync-access, then other tools like wget, lftp,
> > curl or other tools (there are plenty of them, all have pros and cons)
> > are possible escapes.
> >
> > Ralf
> 
> 
> What I need is to also remove old versions automatically while transfering 
> the new ones. I was playing with wget mirror function but it takes 
> everything from the root dir on the remote server but I only need for fc3.
> Looks like lftp could do this job or am I mistaken?


I use the following script to mirror CentOS updates for my servers at
work ... it should be possible to modify it to work with fedora with
some tweaking.   One thing I like about wget is that you can specify a
maximum bandwidth so as to not swamp your internet connection.

The one thing you will have to check is the "--cut-dirs=8" this will
vary depending on your source repository layout.

#!/bin/sh
#
# mirror-centos.sh - Mirror CentOS Linux Updates
#

# Variables
MIRROR="mirror.cs.wisc.edu"
WBDIR="pub/mirrors/linux/caosity.org/centos"
VERSIONS="4"
ARCHS="SRPMS i386 x86_64"
WBUPDATES="/home/ftp/pub/centos"
PROXY="http://firewall.company.com:8080/";

# Limit Transfer Rate to 10K bytes per second
MAXRATE="10k"

# Do the mirror
for d in $VERSIONS; do
  for y in $ARCHS; do
    cd $WBUPDATES
    ## env http_proxy=$PROXY \
    wget --non-verbose --no-host-directories --cut-dirs=8 --mirror \
     --passive-ftp --limit-rate=$MAXRATE \
     --directory-prefix=$WBUPDATES/$d/updates/$y \
     ftp://$MIRROR/$WBDIR/$d/updates/$y 
     ##--output-file=/tmp/mirror-centos.log 

    # the RPMS should be checked for valid sigs, not ready for that yet
    ##rpm --checksig $WBUPDATES/$d/updates/$y/*.rpm | grep 'NOT OK'
  done
done


# Done
exit






[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux