diff --git a/roles/postgres/tasks/_create_backup.yml b/roles/postgres/tasks/_create_backup.yml index 918c22f..e650dfd 100644 --- a/roles/postgres/tasks/_create_backup.yml +++ b/roles/postgres/tasks/_create_backup.yml @@ -44,8 +44,8 @@ backup_file: '{{ backup_dest_dir }}/basebackup_{{ current_date_time }}.tar.gz' shell: | set -o pipefail - /usr/bin/pg_basebackup -Ft -X fetch -D - | pigz -p 4 > {{ backup_file }} && \ - gpg --encrypt --recipient "smardigo automation {{ stage | upper }}" --trust-model always {{ backup_file }} && \ + /usr/bin/pg_basebackup -Ft -X fetch -D - | nice -n15 pigz -p 2 > {{ backup_file }} && \ + nice -n15 gpg --encrypt --recipient "smardigo automation {{ stage | upper }}" --trust-model always {{ backup_file }} && \ rm {{ backup_file }} args: executable: /bin/bash