diff --git a/bubble-server/src/main/resources/packer/roles/bubble/tasks/postgresql.yml b/bubble-server/src/main/resources/packer/roles/bubble/tasks/postgresql.yml index a132caef..19e33b4d 100644 --- a/bubble-server/src/main/resources/packer/roles/bubble/tasks/postgresql.yml +++ b/bubble-server/src/main/resources/packer/roles/bubble/tasks/postgresql.yml @@ -29,3 +29,10 @@ group: postgres mode: 0400 when: install_type == 'sage' + +- name: Install notifications tables' cleaner cron + cron: + name: "Cleaning notifications tables" + special_time: "hourly" + user: "postgres" + job: "HOUR_AGO=$(date -d '1 month ago' +\"%s000\") && psql -d bubble -c \"DELETE FROM sent_notification WHERE mtime < ${HOUR_AGO}\" -c \"DELETE FROM received_notification WHERE mtime < ${HOUR_AGO}\""