Browse Source

set dump file's permissions to 400

Fabian Peter Hammerle 7 years ago
parent
commit
d6630e5857
1 changed files with 1 additions and 1 deletions
  1. 1 1
      tasks/main.yml

+ 1 - 1
tasks/main.yml

@@ -17,7 +17,7 @@
       {%- endif %}
        {{item.source_host}}
       {%- endif %}
-       /usr/bin/mysqldump --opt --order-by-primary --skip-dump-date {{item.database}} | sed 's$),($),\n($g' >"$target_path"; [ "$previous_path" ] && cmp --quiet "$previous_path" "$target_path" && rm "$target_path"
+       /usr/bin/mysqldump --opt --order-by-primary --skip-dump-date {{item.database}} | sed 's$),($),\n($g' >"$target_path"; if [ "$previous_path" ] && cmp --quiet "$previous_path" "$target_path"; then rm "$target_path"; else chmod 400 "$target_path"; fi
   with_items: '{{mysql_backups}}'
   register: mysql_backup_commands
 - name: setup cron jobs