Skip to content

Commit e0bcbfb

Browse files
committed
added dump_perun_without_auditlog.sh
1 parent c992889 commit e0bcbfb

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

tasks/perun_postgres.yml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,22 @@
4141
--exclude-table-data=perun.service_denials \
4242
perun | zstdmt -10 --quiet --force -o "$FILENAME"
4343
44+
- name: "create /var/lib/postgresql/dump_perun_without_auditlog.sh file"
45+
copy:
46+
dest: /var/lib/postgresql/dump_perun_without_auditlog.sh
47+
owner: postgres
48+
group: postgres
49+
mode: 0550
50+
content: |2
51+
#!/bin/bash
52+
FILENAME=perun_wo_auditlog_`date +"%Y-%m-%d-%H-%M-%S"`.sql.zst
53+
echo "dumping PostgreSQL database perun without auditlog into $PWD/$FILENAME ..."
54+
export LANG=cs_CZ.UTF-8
55+
umask 0027
56+
pg_dump \
57+
--exclude-table-data=perun.auditer_log \
58+
perun | zstdmt -10 --quiet --force -o "$FILENAME"
59+
4460
- name: "add extensions"
4561
become: yes
4662
become_user: postgres
@@ -85,7 +101,7 @@
85101
hour: "23"
86102
minute: "20"
87103
user: postgres
88-
job: ": {{ inventory_hostname }} ; cd /var/lib/postgresql; ./dump_psql_db.sh perun"
104+
job: ": {{ inventory_hostname }} ; cd /var/lib/postgresql; ./dump_perun_without_auditlog.sh"
89105

90106
- name: "detect whether user nagios exists"
91107
become: yes

0 commit comments

Comments
 (0)