Google Site SearchFN Site Search FN Blog Login FN Blog Login
Site Navigation:
 
 

Creating a local yum repository

by Alexandre de Abreu

Executing the Script

Before you execute the script, check if your network setup is ok(network access, name resolution, etc) and then fill the PROXY variables as shown in the comments below:

# If you want HTTP Proxy support, fill at least
# PROXY_SERVER and PROXY_PORT variables
# To disable proxy support left it blank
PROXY_SERVER=""
PROXY_PORT=""
# Be carefull with the following credentials, any "ps" will show them
# Use a public user or create rules without auth just from this machine
# when connecting to Mirror's IP addresses tcp port 80(http)
PROXY_USER=""
PROXY_PASS=""

Note that these values will be passed to Wget program and they are blank by default indicating that no Proxy will be used. To execute the script, issue the command:

# su - alex -c /usr/local/bin/yum_repository.sh

If everything was done correctly, you'll see something as the output below:

# su - alex -c /usr/local/bin/yum_repository.sh
[*] Writing logs to /tmp/yum_repository.log
[*] Getting files from http://distro.ibiblio.org/pub/linux/distributions/fedora/linux..
...
[CTRL+C Pressed]
...
[*] Removing PID file..
[*] Exiting..
#

Then we can execute the script in backgroung and see more details with the following commands:

# su - alex -c /usr/local/bin/yum_repository.sh &
# tail -f /tmp/yum_repository.log
[*] Download started: Thu Feb 19 00:12:40 BRT 2004
Connecting to distro.ibiblio.org[152.2.210.109]:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 4,411,603 [audio/x-pn-realaudio-plugin]
 
    0K .......... .......... .......... .......... ..........  1%   10.91 KB/s
   50K .......... .......... .......... .......... ..........  2%   36.47 KB/s
  100K .......... .......... .......... .......... ..........  3%   25.42 KB/s
...
[*] Download complete for http://distro.ibiblio.org/pub/linux/distributions/fedora/linux..
[*] Yum-arch started: Thu Feb 19 00:43:19 BRT 2004
[*] Yum-arch complete for /var/ftp/pub/linux/fedora/1/updates/

As you could see above, you can follow the script process through yum_repository.log file and possibly identify some errors. After things working you can try the line below to setup a cron job for executing the script every six hours:

1 */6 * * * alex /usr/local/bin/yum_repository.sh

On next page you will learn how to rotate the script log and how to setup yum clients so they can update the system using the local repository. Click on the blue arrow to continue.