From feaf6f2dd50357a7886e05b09a4b6299bde8eb8d Mon Sep 17 00:00:00 2001 From: Dan Fandrich Date: Tue, 23 Jan 2024 18:27:16 -0800 Subject: Make the schedbot cleaning jobs actually clean The test jobs seem to be working as desired, so make them actually start deleting the old files every 4 hours. Use -ignore_readdir_race in all of them to avoid errors when schedbot cleans the files in the middle of a run (an unlikely situation because of the clean-up times involved). --- modules/buildsystem/manifests/scheduler.pp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'modules/buildsystem') diff --git a/modules/buildsystem/manifests/scheduler.pp b/modules/buildsystem/manifests/scheduler.pp index 5218b646..7c186a19 100644 --- a/modules/buildsystem/manifests/scheduler.pp +++ b/modules/buildsystem/manifests/scheduler.pp @@ -28,8 +28,8 @@ class buildsystem::scheduler { cron { 'clean uploads logs': user => $login, # Delete old upload logs - command => sprintf("/usr/bin/find %s/uploads -xdev -depth -type f -ctime +%d >/var/lib/schedbot/clean-uploads-logs-test.log 2>&1", shellquote($homedir), shellquote($buildsystem::var::scheduler::clean_uploads_logs_age)), - hour => '*/1', + command => sprintf("/usr/bin/find %s/uploads -ignore_readdir_race -xdev -depth -type f -ctime +%d -delete", shellquote($homedir), shellquote($buildsystem::var::scheduler::clean_uploads_logs_age)), + hour => '*/4', minute => '51', } cron { 'clean uploads dirs': @@ -40,8 +40,8 @@ class buildsystem::scheduler { # every time a file/directory underneath it is deleted. # Directories don't take much space, so this shouldn't be a # real issue. - command => sprintf("/usr/bin/find %s/uploads -ignore_readdir_race -mindepth 5 -xdev -depth -type d -ctime +%d -empty >/var/lib/schedbot/clean-uploads-dirs-test.log 2>&1", shellquote($homedir), shellquote($buildsystem::var::scheduler::clean_uploads_logs_age)), - hour => '*/1', + command => sprintf("/usr/bin/find %s/uploads -ignore_readdir_race -mindepth 5 -xdev -depth -type d -ctime +%d -empty -delete", shellquote($homedir), shellquote($buildsystem::var::scheduler::clean_uploads_logs_age)), + hour => '*/4', minute => '53', } } @@ -49,8 +49,8 @@ class buildsystem::scheduler { cron { 'clean uploads packages': user => $login, # Delete old upload RPMs - command => sprintf("/usr/bin/find %s/uploads -xdev -depth -type f -name '*.rpm' -ctime +%d >/var/lib/schedbot/clean-uploads-packages-test.log 2>&1", shellquote($homedir), shellquote($buildsystem::var::scheduler::clean_uploads_packages_age)), - hour => '*/1', + command => sprintf("/usr/bin/find %s/uploads -ignore_readdir_race -xdev -depth -type f -name '*.rpm' -ctime +%d -delete", shellquote($homedir), shellquote($buildsystem::var::scheduler::clean_uploads_packages_age)), + hour => '*/4', minute => '52', } } -- cgit v1.2.1