From 3e6f395c85965d3ea1f07e004825645f1eedb332 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Luttringer?= Date: Sun, 28 Sep 2014 15:23:51 +0200 Subject: [PATCH] Be more verbose Usefull in service output --- arm-link | 13 +++++-------- package-links | 6 +++--- repo-rsync | 5 +++++ 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/arm-link b/arm-link index 844f61a..18282ad 100755 --- a/arm-link +++ b/arm-link @@ -19,9 +19,6 @@ LOCKFILE=~/."${0##*/}".lock ARMBASE=/srv/ftp/archlinux/arm ARCBASE=/srv/ftp/archlinux/archive/repos -LAST=last -LASTM=month -LASTW=week [[ $1 != "" && ${1:0:1} != / ]] && { echo 'Absolute path please, ln is bugged'; exit 1; } @@ -37,12 +34,12 @@ umask 022 cd "$ARMBASE" # update last -ln -srnf "$(ls -1d "$ARCBASE"/*/*/*|sort|tail -n1)" "$LAST" - -# update last month -ln -srnf "$(date +%Y/%m/01)" "$LASTM" +ln -svrnf "$(ls -1d "$ARCBASE"/*/*/*|sort|tail -n1)" last # update last week -ln -srnf "$(date -d 'last monday' +%Y/%m/%d)" "$LASTW" +ln -srvnf "$ARCBASE/$(date -d 'last monday' +%Y/%m/%d)" week + +# update last month +ln -srvnf "$ARCBASE/$(date +%Y/%m/01)" month # vim:set sw=2 ts=2 ft=sh et: diff --git a/package-links b/package-links index 0a02191..bb7d134 100755 --- a/package-links +++ b/package-links @@ -35,11 +35,11 @@ umask 022 # ensure dirs are here [[ -e $BASE/$PKGFLAT ]] || mkdir -p "$BASE/$PKGFLAT" -echo ":: removing dead links in ${BASE##*/}" +echo "removing dead links in ${BASE##*/}" find -L "$BASE" -type l -delete -print # create new links pass -echo ':: creating new links' +echo 'creating new links' find ${1:-$REPOS} -type f -name '*.pkg.tar.xz' -o -name '*.pkg.tar.xz.sig'| while read src; do filename="${src##*/}" pkgname="${filename%-*}" #remove arch and extension @@ -72,7 +72,7 @@ done # disallow listing of PKGFLAT. Too much file echo 'No listing allowed here.' > "$BASE/$PKGFLAT/index.html" -echo ":: removing empty directories in ${BASE##*/}" +echo "removing empty directories in ${BASE##*/}" find "$BASE" -type d -empty -delete -print touch "$BASE" "$BASE/$PKGFLAT" diff --git a/repo-rsync b/repo-rsync index 8da68fe..6825f28 100755 --- a/repo-rsync +++ b/repo-rsync @@ -35,6 +35,11 @@ umask 022 # ensure destination exists [[ -d $SNAP ]] || mkdir -p "$SNAP" +# display info +echo starting rsync +echo snapshot is: $SNAP +echo last is: $LAST + # Rsync from master using last sync # We must use absolute path with --link-dest to avoid errors rsync -rltH --link-dest="$LAST/" --exclude '*/.*' "$UPSTREAM" "$SNAP/" -- GitLab