Gehel has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/404315 )

Change subject: wdqs: simplify logging of categories reload
......................................................................

wdqs: simplify logging of categories reload

The reload of categories was logged to multiple files, including one that
was timestamped. This generates unnecessary complexity.

My guess is that this multiple logging was done to also log manual reload
of categories, which was usefull during a testing phase where categories
were reloaded manually.

Change-Id: I58199e4c0d4397d2da8308187fb6b870fecf5f80
---
M modules/wdqs/files/cron/reloadCategories.sh
M modules/wdqs/manifests/gui.pp
2 files changed, 8 insertions(+), 17 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/15/404315/1

diff --git a/modules/wdqs/files/cron/reloadCategories.sh 
b/modules/wdqs/files/cron/reloadCategories.sh
index 2710a19..338fa33 100755
--- a/modules/wdqs/files/cron/reloadCategories.sh
+++ b/modules/wdqs/files/cron/reloadCategories.sh
@@ -7,9 +7,10 @@
 newNamespace="categories${today}"
 # Drop old dumps
 rm -f ${DATA_DIR}/*-categories.ttl.gz
-cd $DEPLOY_DIR
+cd ${DEPLOY_DIR}
 # Create new namespace
-bash createNamespace.sh $newNamespace || exit 1
+bash createNamespace.sh ${newNamespace} || exit 1
 # Load the data
-bash forAllCategoryWikis.sh loadCategoryDump.sh $newNamespace >> 
"${LOG_DIR}/${newNamespace}.log"
-replaceNamespace categories $newNamespace
+echo "loading categories in ${newNamespace}"
+bash forAllCategoryWikis.sh loadCategoryDump.sh $newNamespace
+replaceNamespace categories ${newNamespace}
diff --git a/modules/wdqs/manifests/gui.pp b/modules/wdqs/manifests/gui.pp
index d056705..7ff6dfa 100644
--- a/modules/wdqs/manifests/gui.pp
+++ b/modules/wdqs/manifests/gui.pp
@@ -83,7 +83,7 @@
         mode   => '0755',
     }
 
-    $cron_log = "${log_dir}/reloadCategories.log"
+    $reload_categories_log = "${log_dir}/reloadCategories.log"
     # the reload-categories cron needs to reload nginx once the categories are 
up to date
     sudo::user { "${username}-reload-nginx":
       ensure     => present,
@@ -96,7 +96,7 @@
     # do not want them to be too far from one another.
     cron { 'reload-categories':
         ensure  => present,
-        command => "/usr/local/bin/reloadCategories.sh >> ${cron_log}",
+        command => "/usr/local/bin/reloadCategories.sh >> 
${reload_categories_log}",
         user    => $username,
         weekday => 1,
         minute  => fqdn_rand(60),
@@ -114,7 +114,7 @@
 
     logrotate::rule { 'wdqs-reload-categories':
         ensure       => present,
-        file_glob    => $cron_log,
+        file_glob    => $reload_categories_log,
         frequency    => 'monthly',
         missing_ok   => true,
         not_if_empty => true,
@@ -134,14 +134,4 @@
         su           => "${username} wikidev",
     }
 
-    # Remove categories*.log files after 30 days.
-    logrotate::rule { 'wdqs-categories-logs':
-        ensure       => present,
-        file_glob    => "${log_dir}/categories*.log",
-        missing_ok   => true,
-        not_if_empty => true,
-        rotate       => 0,
-        max_age      => 30,
-        su           => "${username} wikidev",
-    }
 }

-- 
To view, visit https://gerrit.wikimedia.org/r/404315
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I58199e4c0d4397d2da8308187fb6b870fecf5f80
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Gehel <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to