@@ -17,7 +17,7 @@
{%- endif %}
{{item.source_host}}
- /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