From 59d57245110302809e6b77ee3c7cd99ebb7eeaf1 Mon Sep 17 00:00:00 2001 From: Dan Fandrich Date: Mon, 15 Jan 2024 23:28:56 -0800 Subject: Add a test cron job to see how it would clean up upload logs The Puppet method for doing this seems to be what's causing its memory usage to reach the size of the physical RAM in the system and take up to 4 days to complete a Puppet run. The test will show the files being deleted and how long it takes, but won't actually delete them. --- modules/buildsystem/manifests/scheduler.pp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'modules/buildsystem') diff --git a/modules/buildsystem/manifests/scheduler.pp b/modules/buildsystem/manifests/scheduler.pp index 47ac036e..9848f109 100644 --- a/modules/buildsystem/manifests/scheduler.pp +++ b/modules/buildsystem/manifests/scheduler.pp @@ -31,6 +31,14 @@ class buildsystem::scheduler { age => $buildsystem::var::scheduler::clean_uploads_logs_age, rmdirs => true, } + + cron { 'clean uploads logs': + user => $login, + # TEMPORARY to test what be deleted before replacing the above + command => sprintf("/usr/bin/find %s/uploads -xdev -type f -mtime +14 >/var/lib/schedbot/clean-uploads-logs-test.log", shellquote(${buildsystem::var::scheduler::homedir})), + hour => '*/4', + minute => '51', + } } if ($buildsystem::var::scheduler::clean_uploads_packages_age != '0') { tidy { "${buildsystem::var::scheduler::homedir}/uploads/**/*.rpm": -- cgit v1.2.1