Skip to content
Snippets Groups Projects
Commit 22f7f776 authored by Daniel Abad's avatar Daniel Abad
Browse files

WIP [LOS-535] do not merge here

parent 3edca1e7
No related branches found
No related tags found
No related merge requests found
#!/bin/bash
#
# lxsoft-sync-afs
#
# 3.3.2006 v0.1 - Jaroslaw.Polok@cern.ch
#
# $Id: lxsoft-sync-afs,v 1.9 2009/10/02 13:07:46 jarek Exp $
[[ $EUID -eq 0 ]] && echo "Do not run it as root. Exit!" && exit 1
MASTER=lxsoftadm01.cern.ch
[ -f /etc/lxsoft.conf ] && . /etc/lxsoft.conf
[ x`/bin/hostname` != x$MASTER ] && echo "This host (`/bin/hostname`) is not MASTER ($MASTER). Exit." && exit 0
SYNC=all
VERBOSE=0
CHECKSUM=0
NOACTION=0
RSYNC="/usr/bin/rsync"
RSYNC_OPTS=" -rlptD --safe-links --delay-updates --delete-after --max-delete=500 --timeout=300"
RSYNC_VERBOSE=" -v"
help() {
echo "`basename $0` [ -v ] [ -f ] [ -s ARG ]"
echo " -c = enforce rsync checksums (slow!!)"
echo " -v = more verbose sync"
echo " -q = be quiet"
echo " -n = noaction"
echo " -s ARG , where ARG mirror, lcg, egee, wlcg, lemon" #lemon, quattor, wlcg"
exit 0
}
while getopts ":vqnchs:" flag
do
[ "$flag" == "v" ] && VERBOSE=1
[ "$flag" == "h" ] && help
[ "$flag" == "s" ] && SYNC=$OPTARG
[ "$flag" == "c" ] && CHECKSUM=1
[ "$flag" == "n" ] && NOACTION=1
[ "$flag" == "q" ] && RSYNC_VERBOSE=""
done
RSYNC_OPTS="$RSYNC_OPTS $RSYNC_VERBOSE"
TOP_AFS="/afs/cern.ch/project/gd/wlcg-repo/";
TOP_LOCAL="/mnt/data1/dist/wlcg/";
RSYNC_OPTS="$RSYNC_OPTS --exclude private/";
[ "$SYNC" == "all" ] && TODO="mirror" || TODO=$SYNC
[ $VERBOSE -eq 1 ] && RSYNC_OPTS="$RSYNC_OPTS --progress"
[ $CHECKSUM -eq 1 ] && RSYNC_OPTS="$RSYNC_OPTS -c"
[ $NOACTION -eq 1 ] && RSYNC_OPTS="$RSYNC_OPTS -n"
for COMP in ${TODO}; do
RSYNC_OPTS_ORG=$RSYNC_OPTS
case "$COMP" in
"lcg") TOP_AFS="/afs/cern.ch/project/gd/www/gis/aptDB/"; TOP_LOCAL="/mnt/data1/dist/LCG/aptDB/" ;;
"egee") TOP_AFS="/afs/cern.ch/project/egee/gLite/"; TOP_LOCAL="/mnt/data1/dist/EGEE/gLite/" ;;
# "lemon") TOP_AFS="/afs/cern.ch/project/lemon/"; TOP_LOCAL="/mnt/data1/dist/lemon/" ;;
# "quattor") TOP_AFS="/afs/cern.ch/project/quattor/"; TOP_LOCAL="/mnt/data1/dist/quattor/" ;;
"wlcg") TOP_AFS="/afs/cern.ch/project/gd/wlcg-repo/"; TOP_LOCAL="/mnt/data1/dist/wlcg/" ; RSYNC_OPTS="$RSYNC_OPTS --exclude private/";;
*) echo "Error: unknown comp to sync"; exit 1 ;;
esac
if [ "$RSYNC_VERBOSE" != "" ]; then
echo "Starting `basename $0` at `date` for $COMP"
fi
echo "Running: $RSYNC $TOP_AFS $TOP_LOCAL $RSYNC_OPTS"
$RSYNC $TOP_AFS $TOP_LOCAL $RSYNC_OPTS
RSYNC_OPTS=$RSYNC_OPTS_ORG
done
if [ "$RSYNC_VERBOSE" != "" ]; then
echo "Finished `basename $0` at `date`."
fi
$RSYNC $TOP_AFS $TOP_LOCAL $RSYNC_OPTS
......@@ -5,14 +5,9 @@ VERBOSE=0
CHECKSUM=0
NOACTION=0
MASTER=lxsoftadm01.cern.ch
[ -f /etc/lxsoft.conf ] && . /etc/lxsoft.conf
[ x`/bin/hostname` != x$MASTER ] && echo "This host (`/bin/hostname`) is not MASTER ($MASTER). Exit." && exit 0
MIRROR="rsync://ftp.fau.de/fedora/linux"
#MIRROR="rsync://fedora.mirrors.ovh.net/download.fedora.redhat.com/linux"
#MIRROR="rsync://mirrors.ircam.fr/fedora-linux/"
MIRROR="rsync://mirror.in2p3.fr/pub/fedora/linux/"
RSYNC="/usr/bin/rsync"
RSYNC_OPTS=" -H -rlptD --safe-links --delay-updates --delete-after --max-delete=10000 --timeout=3600 --exclude=.*rpm.?* --exclude=.~tmp~"
RSYNC_VERBOSE=" -v"
......
#!/bin/bash
#
# lxarchive-sync-scientific
#
# Jaroslaw.Polok@cern.ch
MASTER=lxsoftadm01.cern.ch
[ -f /etc/lxsoft.conf ] && . /etc/lxsoft.conf
[ x`/bin/hostname` != x$MASTER ] && echo "This host (`/bin/hostname`) is not MASTER ($MASTER). Exit." && exit 0
MIRRORSL="rsync.scientificlinux.org::scientific"
SYNC=all
VERBOSE=0
CHECKSUM=0
NOACTION=0
RSYNC="/usr/bin/rsync"
# exclude "hidden" rpm files - typicall other (upstream) rsync in progress..
RSYNC_OPTS=" -H -rlptD --safe-links --delay-updates --delete-after --max-delete=5000 --timeout=6000 --exclude=.*rpm.?*"
RSYNC_VERBOSE=" -v"
help() {
echo "`basename $0` [ -c ] [ -v ] [ -q ] [ -n ] [ -f ] [ -s ARG ]"
echo " -c = enforce rsync checksums (VERY slow!!)"
echo " -v = more verbose sync"
echo " -q = be quiet"
echo " -n = noaction"
echo " -s ARG , where ARG scientific"
exit 0
}
while getopts ":vqnchas:" flag
do
[ "$flag" == "v" ] && VERBOSE=1
[ "$flag" == "h" ] && help
[ "$flag" == "s" ] && SYNC=$OPTARG
[ "$flag" == "c" ] && CHECKSUM=1
[ "$flag" == "n" ] && NOACTION=1
[ "$flag" == "q" ] && RSYNC_VERBOSE=""
done
RSYNC_OPTS="$RSYNC_OPTS $RSYNC_VERBOSE"
[ "$SYNC" == "all" ] && TODO="scientific" || TODO=$SYNC
[ $VERBOSE -eq 1 ] && RSYNC_OPTS="$RSYNC_OPTS --progress"
[ $CHECKSUM -eq 1 ] && RSYNC_OPTS="$RSYNC_OPTS -c"
[ $NOACTION -eq 1 ] && RSYNC_OPTS="$RSYNC_OPTS -n"
for COMP in ${TODO}; do
RSYNC_OPTS_ORG=$RSYNC_OPTS
case "$COMP" in
"scientific") TOP_REMOTE=$MIRRORSL;
TOP_LOCAL="/mnt/data1/dist/scientific";
RSYNC_OPTS="$RSYNC_OPTS --exclude=obsolete/" ;;
*) echo "Error: unknown comp to sync"; exit 1 ;;
esac
# exclude "hidden" rpm files - typical other (upstream) rsync in progress..
#-c = enforce rsync checksums (VERY slow!!)"
RSYNC_OPTS=" -H -rlptD --safe-links --delay-updates --delete-after --max-delete=5000 --timeout=6000 --exclude=.*rpm.?*"
RSYNC_OPTS="$RSYNC_OPTS -v --progress -c -n"
RSYNC_OPTS="$RSYNC_OPTS --exclude=obsolete/"
if [ "$RSYNC_VERBOSE" != "" ]; then
echo "Starting `basename $0` at `date` for $COMP"
echo "Running: $RSYNC $TOP_REMOTE/ $TOP_LOCAL/ $RSYNC_OPTS"
fi
eval $RSYNC $TOP_REMOTE/ $TOP_LOCAL/ $RSYNC_OPTS
ret=$?
[ "$ret" -eq 0 ] || echo "last $RSYNC returned an error: $ret"
if [ "$RSYNC_VERBOSE" != "" ]; then
echo "Finished `basename $0` at `date`."
fi
TOP_REMOTE="rsync.scientificlinux.org::scientific"
TOP_LOCAL="/mnt/data1/dist/scientific";
RSYNC_OPTS=$RSYNC_OPTS_ORG
eval $RSYNC $TOP_REMOTE/ $TOP_LOCAL/ $RSYNC_OPTS
done
ret=$?
[ "$ret" -eq 0 ] || echo "last $RSYNC returned an error: $ret"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment