ArielGlenn has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/395495 )

Change subject: remove extraneous cleanups for misc dumps from scripts and crons
......................................................................


remove extraneous cleanups for misc dumps from scripts and crons

Cleanup is all handled in one place now, we can get rid of the rest

Change-Id: I1b9104944c9124f01dc9fafcf33c90b0eacad693
---
M modules/snapshot/files/cron/dumpcategoriesrdf.sh
M modules/snapshot/files/cron/dumpcirrussearch.sh
M modules/snapshot/manifests/cron/dump_global_blocks.pp
M modules/snapshot/manifests/cron/pagetitles.pp
4 files changed, 0 insertions(+), 59 deletions(-)

Approvals:
  ArielGlenn: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/modules/snapshot/files/cron/dumpcategoriesrdf.sh 
b/modules/snapshot/files/cron/dumpcategoriesrdf.sh
index 9ce2364..abb175e 100755
--- a/modules/snapshot/files/cron/dumpcategoriesrdf.sh
+++ b/modules/snapshot/files/cron/dumpcategoriesrdf.sh
@@ -69,26 +69,6 @@
 timestampsDir="${targetDirBase}/lastdump"
 multiVersionScript="${deployDir}/multiversion/MWScript.php"
 
-# remove old datasets
-daysToKeep=70
-cutOff=$(( $(date +%s) - $(( $daysToKeep + 1 )) * 24 * 3600))
-if [ -d "$targetDirBase" ]; then
-       for folder in $(ls -d -r "${targetDirBase}/"*); do
-               creationTime=$(date --utc --date="$(basename $folder)" +%s 
2>/dev/null)
-               if [ -n "$creationTime" ]; then
-                   if [ "$cutOff" -gt "$creationTime" ]; then
-                       if [ "$dryrun" == "true" ]; then
-                               echo rm "${folder}/"*".${dumpFormat}.gz"
-                               echo rmdir "${folder}"
-                       else
-                               rm -f "${folder}/"*".${dumpFormat}.gz"
-                               rmdir "${folder}"
-                       fi
-                   fi
-               fi
-       done
-fi
-
 # create todays folder
 if [ "$dryrun" == "true" ]; then
        echo mkdir -p "$targetDir"
diff --git a/modules/snapshot/files/cron/dumpcirrussearch.sh 
b/modules/snapshot/files/cron/dumpcirrussearch.sh
index c6d7547..61c2cce0 100644
--- a/modules/snapshot/files/cron/dumpcirrussearch.sh
+++ b/modules/snapshot/files/cron/dumpcirrussearch.sh
@@ -57,26 +57,6 @@
 targetDir="$targetDirBase/$today"
 multiVersionScript="$deployDir/multiversion/MWScript.php"
 
-# remove old datasets
-daysToKeep=70
-cutOff=$(( $(date +%s) - $(( $daysToKeep + 1 )) * 24 * 3600))
-if [ -d "$targetDirBase" ]; then
-       for folder in $(ls -d -r $targetDirBase/*); do
-               creationTime=$(date --utc --date="$(basename $folder)" +%s 
2>/dev/null)
-               if [ -n "$creationTime" ]; then
-                   if [ "$cutOff" -gt "$creationTime" ]; then
-                       if [ "$dryrun" == "true" ]; then
-                               echo rm $folder/*.json.gz
-                               echo rmdir $folder
-                       else
-                               rm -f $folder/*.json.gz
-                               rmdir $folder
-                       fi
-                   fi
-               fi
-       done
-fi
-
 # create todays folder
 if [ "$dryrun" == "true" ]; then
        echo mkdir -p "$targetDir"
diff --git a/modules/snapshot/manifests/cron/dump_global_blocks.pp 
b/modules/snapshot/manifests/cron/dump_global_blocks.pp
index 71315af..93fb232 100644
--- a/modules/snapshot/manifests/cron/dump_global_blocks.pp
+++ b/modules/snapshot/manifests/cron/dump_global_blocks.pp
@@ -13,16 +13,6 @@
         source => 'puppet:///modules/snapshot/cron/dump-global-blocks.sh',
     }
 
-    cron { 'global_blocks_cleanup':
-        ensure      => 'present',
-        environment => '[email protected]',
-        user        => $user,
-        command     => "find ${globalblocksdir}/ -maxdepth 1 -type d -mtime 
+90 -exec rm -rf {} \\;",
-        minute      => '0',
-        hour        => '8',
-        weekday     => '6',
-    }
-
     cron { 'global_blocks_dump':
         ensure      => 'present',
         command     => "/usr/local/bin/dump-global-blocks.sh --config 
${confsdir}/wikidump.conf",
diff --git a/modules/snapshot/manifests/cron/pagetitles.pp 
b/modules/snapshot/manifests/cron/pagetitles.pp
index ab01cdb..3574143 100644
--- a/modules/snapshot/manifests/cron/pagetitles.pp
+++ b/modules/snapshot/manifests/cron/pagetitles.pp
@@ -5,15 +5,6 @@
     $repodir = $snapshot::dumps::dirs::repodir
     $confsdir = $snapshot::dumps::dirs::confsdir
 
-    cron { 'titles-cleanup':
-        ensure      => 'present',
-        environment => '[email protected]',
-        user        => $user,
-        command     => "find ${cronsdir}/pagetitles/ -maxdepth 1 -type d 
-mtime +90 -exec rm -rf {} \\; ; find ${cronsdir}/mediatitles/ -maxdepth 1 
-type d -mtime +90 -exec rm -rf {} \\;",
-        minute      => '0',
-        hour        => '8',
-    }
-
     cron { 'pagetitles-ns0':
         ensure      => 'present',
         environment => '[email protected]',

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I1b9104944c9124f01dc9fafcf33c90b0eacad693
Gerrit-PatchSet: 2
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: ArielGlenn <[email protected]>
Gerrit-Reviewer: ArielGlenn <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to