From 92679459d4cdf730db9b597ebefff8f8a711fcdb Mon Sep 17 00:00:00 2001 From: Michael Simacek Date: Tue, 7 Jul 2015 13:02:49 +0000 Subject: [PATCH] Add vacuum of package table to koschei cron --- roles/koschei/files/cron-db-cleanup | 1 - roles/koschei/tasks/main.yml | 4 +--- roles/koschei/templates/cron-db-cleanup.j2 | 2 ++ 3 files changed, 3 insertions(+), 4 deletions(-) delete mode 100644 roles/koschei/files/cron-db-cleanup create mode 100644 roles/koschei/templates/cron-db-cleanup.j2 diff --git a/roles/koschei/files/cron-db-cleanup b/roles/koschei/files/cron-db-cleanup deleted file mode 100644 index 4b0b794305..0000000000 --- a/roles/koschei/files/cron-db-cleanup +++ /dev/null @@ -1 +0,0 @@ -0 4 * * * koschei koschei-admin cleanup --older-than 6 diff --git a/roles/koschei/tasks/main.yml b/roles/koschei/tasks/main.yml index 7b735ab1bf..62a3f4fda8 100644 --- a/roles/koschei/tasks/main.yml +++ b/roles/koschei/tasks/main.yml @@ -103,9 +103,7 @@ - selinux - name: Copy the cleanup cronjob - copy: src="{{item}}" dest="/etc/cron.d/{{item}}" - with_items: - - cron-db-cleanup + template: src=cron-db-cleanup.j2 dest=/etc/cron.d/cron-db-cleanup tags: - koschei diff --git a/roles/koschei/templates/cron-db-cleanup.j2 b/roles/koschei/templates/cron-db-cleanup.j2 new file mode 100644 index 0000000000..32fdf5fd58 --- /dev/null +++ b/roles/koschei/templates/cron-db-cleanup.j2 @@ -0,0 +1,2 @@ +0 3 * * * koschei koschei-admin cleanup --older-than 6 +0 4 * * * koschei psql -h {{ koschei_pgsql_hostname }} -d koschei -U koscheiadmin -c 'VACUUM FULL ANALYZE package;'