Sha256: eabfac4d7cab43f0e4231339f92028e325abd10d6c889e714602678b45992c74

Contents?: true

Size: 856 Bytes

Versions: 1

Compression:

Stored size: 856 Bytes

Contents

#!/bin/bash

# This file was generated by Ansible for {{ ansible_fqdn }}
# Do NOT modify this file by hand!

WORKDIR={{backup_work}}/{{item.name}}

{% if item.source.startswith('postgresql://') %}

DBNAME={{item.source.split('postgresql://')[-1]}}
psql -U {{backup_postgres_user}} {{ '-h ' + backup_postgres_host  if backup_postgres_host else ''}} {{ ('-p %s' % backup_postgres_port)  if backup_postgres_port else ''}} $DBNAME < $WORKDIR/dump
rm -rf $WORKDIR/dump

{% elif item.source.startswith('mysql://') %}

DBNAME={{item.source.split('mysql://')[-1]}}
mysql -u {{backup_mysql_user}} -p{{backup_mysql_pass}} $DBNAME  < ${WORKDIR}/dump
rm -rf $WORKDIR/dump

{% elif item.source.startswith('mongo://') %}

mongorestore --drop $WORKDIR/dump
rm -rf $WORKDIR/dump

{% endif %}

{% for action in item.restore_actions|default([]) %}
{{ action }}
{% endfor %}

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
taperole-1.6.0 vendor/Stouts.backup/templates/restore.j2