diff --git a/roles/elasticsearch/templates/post-backup.j2 b/roles/elasticsearch/templates/post-backup.j2 index 59afb96..cc1bbfa 100644 --- a/roles/elasticsearch/templates/post-backup.j2 +++ b/roles/elasticsearch/templates/post-backup.j2 @@ -1,9 +1,5 @@ #!/bin/bash -e -{% if es_backup_dir != '' and es_backup_dir != '/' %} -rm -rf {{ es_backup_dir }}/* -{% else %} -# Can't delete elasticsearch dumps, set es_backup_dir to a non empty path -{% endif %} +curl -X DELETE http://localhost:{{ es_port }}/_snapshot/lbkp/lbkp umount /home/lbkp/es fstrim -a -v diff --git a/roles/mysql_server/templates/pre-backup.j2 b/roles/mysql_server/templates/pre-backup.j2 index 1444879..8f4adce 100644 --- a/roles/mysql_server/templates/pre-backup.j2 +++ b/roles/mysql_server/templates/pre-backup.j2 @@ -11,6 +11,9 @@ DEST=/home/lbkp/mysql for DB in $(/usr/bin/mysqlshow | /bin/awk '{print $2}' | /bin/grep -v Databases) do + if [[ "$DB" == "information_schema" ]]; then + continue + fi {% for db in mysql_skip_backup %} # {{ db }} is configured not to be backed up if [[ "$DB" == "{{ db }}" ]]; then