From 1710d1108bc4c50868e560fa44e305cc24a8488f Mon Sep 17 00:00:00 2001 From: Salt Date: Tue, 29 Dec 2020 09:08:38 -0600 Subject: [PATCH] Fix backup script to exclude items BEFORE the main arguments --- roles/backup/templates/s3backup.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/roles/backup/templates/s3backup.sh b/roles/backup/templates/s3backup.sh index 028a144..d145d28 100644 --- a/roles/backup/templates/s3backup.sh +++ b/roles/backup/templates/s3backup.sh @@ -51,10 +51,11 @@ echo "Will ignore the following items:" echo "- {{ item }}" {% endfor %} echo "Will upload resultant backup to {{ backup_s3_bucket }}" -nice -n 10 tar {{ backup_s3backup_tar_args }}{{ backup_s3backup_tar_args_extra }} "${DIRS[@]}" \ +nice -n 10 tar {{ backup_s3backup_tar_args }}{{ backup_s3backup_tar_args_extra }} \ {% for item in backup_s3backup_exclude_list + backup_s3backup_exclude_list_extra %} --exclude "{{ item }}" \ {% endfor %} + "${DIRS[@]" \ | aws s3 cp - \ "s3://{{ backup_s3_bucket }}/{{ inventory_hostname_short }}/$(date "+{{ backup_dateformat }}").tar.gz"