Create daily Cron job for PostgreSQL cleanup
This commit is contained in:
parent
edd1ea8246
commit
0e23bef788
2 changed files with 11 additions and 0 deletions
3
files/pg_cleanup
Normal file
3
files/pg_cleanup
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
#!/bin/sh -e
|
||||||
|
|
||||||
|
sudo -u postgres sh -e -c "test -d /var/lib/postgresql/backups/12/main && find /var/lib/postgresql/backups/12/main -type f -mtime +35 -exec rm {} \;"
|
|
@ -16,3 +16,11 @@
|
||||||
mode: 'u=rwx,g=rx,o=rx'
|
mode: 'u=rwx,g=rx,o=rx'
|
||||||
owner: root
|
owner: root
|
||||||
group: root
|
group: root
|
||||||
|
|
||||||
|
- name: Create daily Cron job for PostgreSQL cleanup
|
||||||
|
copy:
|
||||||
|
src: ../../files/pg_cleanup
|
||||||
|
dest: /etc/cron.daily/pg_cleanup
|
||||||
|
mode: 'u=rwx,g=rx,o=rx'
|
||||||
|
owner: root
|
||||||
|
group: root
|
||||||
|
|
Reference in a new issue