Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

CentOS Repo Server

By: a guest on Feb 12th, 2013  |  syntax: None  |  size: 0.77 KB  |  views: 706  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. #!/bin/bash
  2. #repo-setup.sh
  3.  
  4. verlist="5 6"
  5. archlist="x86_64 i386"
  6. baselist="addons contrib extras iso os updates"
  7. local=/var/www/html/centos
  8.  
  9. for ver in $verlist
  10.  do
  11.   for base in $baselist
  12.    do
  13.     for arch in $archlist
  14.      do
  15.       path=$local/$ver/$base/$arch/
  16.           mkdir -pv $path
  17.           cd $path
  18.       reposync .
  19.      done
  20.    done
  21.  done
  22.  
  23. #!/bin/bash
  24. # repo-sync.sh
  25.  
  26. rsync="rsync -avrt --exclude=debug/"
  27. mirror=rsync://mirrors.kernel.org/centos
  28. verlist="5 6"
  29. archlist="x86_64 i386"
  30. baselist="addons contrib extras iso os updates"
  31. local=/var/www/html/centos
  32.  
  33. for ver in $verlist
  34.  do
  35.   for base in $baselist
  36.    do
  37.     for arch in $archlist
  38.      do
  39.       path="$ver/$base/$arch/"
  40.       $rsync $mirror/$path $local/$path
  41.      done
  42.    done
  43.  done