Skip to content

Instantly share code, notes, and snippets.

@N0NamedGuy
Created December 4, 2012 14:49
Show Gist options
  • Select an option

  • Save N0NamedGuy/4204710 to your computer and use it in GitHub Desktop.

Select an option

Save N0NamedGuy/4204710 to your computer and use it in GitHub Desktop.
Mirror sites script
#!/bin/bash
# mirror.sh
# Copyright (C) 2012 David Serrano
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# Path to the file with all the sites that you intend to mirror
MIRRORS="mirrorlist"
# Path to where you want the mirrors
MIRROR_DST="/srv/http/univ/mirrors"
cd $MIRROR_DST
while read line
do echo -e "$line\n"
wget -rkp -l6 -np -N $line
done < $MIRRORS
cd -
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment