Nemo bis has uploaded a new change for review. https://gerrit.wikimedia.org/r/117250
Change subject: Add cron job to run characterEditStats.php on multilingual wikis weekly ...................................................................... Add cron job to run characterEditStats.php on multilingual wikis weekly Publishes the output to noc.wikimedia.org and a wiki page on Meta. Needs a MediaWiki install (with Translate), hence on fenari. Inspired partly by misc/beta/sync-site-resources and files/icinga/check_job_queue. Bug: 58440 Change-Id: I681539b6cf2463648d4c5669d689143c2f41cc33 --- A files/misc/scripts/characterEditStatsTranslate M manifests/misc/maintenance.pp M manifests/site.pp 3 files changed, 36 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/50/117250/1 diff --git a/files/misc/scripts/characterEditStatsTranslate b/files/misc/scripts/characterEditStatsTranslate new file mode 100644 index 0000000..f0f8c88 --- /dev/null +++ b/files/misc/scripts/characterEditStatsTranslate @@ -0,0 +1,17 @@ +#!/bin/bash +# Maintenance report script to produce activity stats for some Translate wikis +REPORT="$HOME/public_html/Translate-wikis-characterEditStats.txt" + +echo -e "{{/Report}} generated on $(date --rfc-3339=seconds)\n" > $REPORT +for wiki in commonswiki incubatorwiki mediawikiwiki metawiki outreachwiki wikidata; do + echo -e "== $wiki ==\n=== Last 30 days ===\n<pre>\n" >> $REPORT + /usr/local/bin/mwscript extensions/Translate/scripts/characterEditStats.php \ + --top 50 --days 30 >> $REPORT + echo -e "</pre>\n=== Last year ===\n<pre>" >> $REPORT + /usr/local/bin/mwscript extensions/Translate/scripts/characterEditStats.php \ + --days 365 >> $REPORT + echo -e "</pre>\n" >> $REPORT + done + +cat $REPORT | /usr/local/bin/mwscript edit.php --wiki=metawiki --user "FuzzyBot" \ + --bot --summary "Update stats" "Meta:Babylon/Translation_stats" \ No newline at end of file diff --git a/manifests/misc/maintenance.pp b/manifests/misc/maintenance.pp index 32e60ae..cb5c794 100644 --- a/manifests/misc/maintenance.pp +++ b/manifests/misc/maintenance.pp @@ -369,6 +369,23 @@ } +class misc::maintenance::updatetranslationstats( $enabled = false ) { + # Include this to a maintenance host to update translation stats. + + cron { 'updatetranslationstats': + user => mwdeploy, + minute => 0, + hour => 0, + weekday => 1, + command => "/usr/bin/characterEditStatsTranslate", + ensure => $enabled ?{ + true => present, + false => absent, + default => absent + }; + } +} + class misc::maintenance::updatequerypages( $enabled = false ) { # Include this to add cron jobs calling updateSpecialPages.php on all clusters. diff --git a/manifests/site.pp b/manifests/site.pp index c5a534a..be8c070 100644 --- a/manifests/site.pp +++ b/manifests/site.pp @@ -880,7 +880,8 @@ accounts::erosen, generic::wikidev-umask, misc::dsh, - ssh::hostkeys-collect + ssh::hostkeys-collect, + misc::maintenance::updatetranslationstats install_certificate{ "noc.wikimedia.org": } } -- To view, visit https://gerrit.wikimedia.org/r/117250 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I681539b6cf2463648d4c5669d689143c2f41cc33 Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Nemo bis <federicol...@tiscali.it> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits