aboutsummaryrefslogtreecommitdiffstats
path: root/get-www-stats
diff options
context:
space:
mode:
authorMarcin Owsiany <porridge>2012-05-13 18:57:29 +0000
committerMarcin Owsiany <porridge>2012-05-13 18:57:29 +0000
commit31e2ce3ddf8989d588b31e78cda0c75b98f3562c (patch)
tree580169a1dc493f41d5142d80efd24cd42ede0f4c /get-www-stats
parentf1953472ec8e22cd03d9829e218f72bcdacd2021 (diff)
Document the actual commands used for generating stats, for easiness of recovery.
CVS version numbers get-www-stats: 1.1 -> 1.2
Diffstat (limited to 'get-www-stats')
-rwxr-xr-xget-www-stats10
1 files changed, 8 insertions, 2 deletions
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 <http://www.gnu.org/licenses/>.
-# 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

© 2014-2024 Faster IT GmbH | imprint | privacy policy