From SpectLog
Revision as of 22:06, 9 December 2014 by UVSMTID (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search


Basic approach

Go to the following web page: https://mirrors.fedoraproject.org/publiclist/EPEL/


Select one of the mirrors based on the following criterias:

  • Required of EPEL repository (version, architecture).
  • Geographically closest repository.
  • Repository accessible with rsync protocol.


Run the following command:

rsync -arv --progress rsync://example.com/epel/ epel/


Partial download

If only specific version of EPEL repository is required, review repository through http protocol in the browser and select required subdirectories only.


For example, content required only for EPEL5 can be selected like this:

rsync -arv --progress rsync://example.com/epel/{5/,5Server/,5Client/,fullfilelist,RPM-GPG-KEY-EPEL-5} epel/


Script for auto retries

Now, if the connection is not stable and unattended restart it required, run the loop until command succeeds:

 BASE_URL="rsync://example.com/epel"
 
 COUNTER=0; RET_VAL="1"; time while [ "$RET_VAL" != "0" ]
 do
    rsync -arv --log-file=rsync.log.$COUNTER --progress $BASE_URL/{5/,5Server/,5Client/,fullfilelist,RPM-GPG-KEY-EPEL-5} epel/
    RET_VAL="$?"
    COUNTER="$((COUNTER + 1))"
 done

For convenience this script can be copied-and-pasted from the 3rd line while setting BASE_URL manually.


To test retry, kill one of the rsync processes in a separate shell.


Canceling this script using Ctrl+C will cause repeated retries. Suspend it instead by Ctrl+Z and kill the job which PID can be printed by this command:

jobs -l