diff options
Diffstat (limited to 'scripts/rsync-generation')
-rwxr-xr-x | scripts/rsync-generation/push-rsync1.sh | 32 |
1 files changed, 15 insertions, 17 deletions
diff --git a/scripts/rsync-generation/push-rsync1.sh b/scripts/rsync-generation/push-rsync1.sh index fc15894ecd..c9df9a379d 100755 --- a/scripts/rsync-generation/push-rsync1.sh +++ b/scripts/rsync-generation/push-rsync1.sh @@ -1,25 +1,23 @@ #!/usr/bin/env bash -TRGDIR="rsync1.domain::rsync-push_module" +TRGDIR="/path/to/rsync0-prefix-tree" LOCALDIR="/path/to/master-rsync-tree" -# figure out what's currently the active rsync1 mirror -#active=$(ssh $TRGHOST "readlink $TRGDIR/rsync1") -#echo "($(date +"%F %R")) current active snapshot on rsync1: ${active}" - -#case $active in -# rsync1a) target=rsync1b ;; -# rsync1b) target=rsync1a ;; -# *) -# echo "don't know what the active rsync1 mirror is: '$active'" > /dev/stderr -# exit 1 -# ;; -#esac -echo "($(date +"%F %R")) will refresh and activate snapshot: ${target}" +echo "($(date +"%F %R")) will refresh snapshot" # synchronise the target -rsync -va --delete "${LOCALDIR}"/ ${TRGDIR}/ > /var/tmp/rsync-updates.log || exit 1 +rsync -vca --delete --exclude=snapshots/ \ + "${LOCALDIR}"/ ${TRGDIR}/ > /var/tmp/rsync-updates.log || exit 1 +PUBLICDIR= +case $(hostname) in + disabled) + PUBLICDIR="somehost::gentoo-portage-prefix-push" + ;; +esac # switch the active rsync1 mirror -echo "($(date +"%F %R")) rsync done, switching target now" -#ssh $TRGHOST "cd ${TRGDIR} && rm rsync1 && ln -s ${target} rsync1" +if [[ -n ${PUBLICDIR} ]] ; then + rsync -vca --delete "${TRGDIR}"/ "${PUBLICDIR}"/ +fi + +echo "($(date +"%F %R")) rsync done" |