From 31e2ce3ddf8989d588b31e78cda0c75b98f3562c Mon Sep 17 00:00:00 2001 From: Marcin Owsiany Date: Sun, 13 May 2012 18:57:29 +0000 Subject: Document the actual commands used for generating stats, for easiness of recovery. CVS version numbers get-www-stats: 1.1 -> 1.2 --- get-www-stats | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'get-www-stats') diff --git a/get-www-stats b/get-www-stats index 2fb461eb23f..17a0ec8b9fb 100755 --- a/get-www-stats +++ b/get-www-stats @@ -17,9 +17,15 @@ # along with this program. If not, see . -# This program is run daily on a Debian website mirror like this: +# This program is run from a crontab on a Debian website mirror like this: # -# get-www-stats > stats.txt-pending && mv stats.txt-pending stats.txt +# # Atomically and concurrent-safely create a stats.tgz +# 18 3 * * * cd "$HOME" && d=$(mktemp -d stats-wip-XXXXXXXXXX) && printf '{"hostname:"\%s"}' $(hostname -f) > "$d/stats.meta.json" && ./get-www-stats > "$d/stats.json" && tar zcf stats-wip.tgz "$d" && rm -rf "$d" && mv stats-wip.tgz stats.tgz +# +# And the output is transferred to dde.debian.net like this: +# +# # Atomically transfer stats and replace them. +# 18 4 * * * cd $HOME && { [ ! -e stats-old ] || please_cleanup_failed_run ; } && cp -al stats-new stats-old && ln -s stats-old stats-old.s && mv -T stats-old.s stats && { scp -q -i .ssh/stats-transfer-nopass senfl.debian.org:stats.tgz stats.tgz || scp_failed ; } && rm -rf stats-new && mkdir stats-new && tar zxf stats.tgz -C stats-new --strip-components=1 && rm stats.tgz && ln -s stats-new stats-new.s && mv -T stats-new.s stats && rm -rf stats-old # # The output is then exported via DDE (see http://wiki.debian.org/DDE) and used # by the stattrans.pl script to sort the page lists in the Debian web site -- cgit v1.2.3