commit:     e766d7ea7dae4c0f454a3e3a69f2f6bb3aba5ec8
Author:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Thu Mar 28 14:56:42 2024 +0000
Commit:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Thu Mar 28 14:56:42 2024 +0000
URL:        https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=e766d7ea

scripts/rsync-generation/push-rsync1: update to current usage

Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org>

 scripts/rsync-generation/push-rsync1.sh | 32 +++++++++++++++-----------------
 1 file 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"

Reply via email to