Commit 0743d5eb authored by Marco Mariani's avatar Marco Mariani

abialian: postgres-restore does not fallback to var/backup

but requires an explicit path.
parent f4479fc5
...@@ -151,8 +151,11 @@ template = inline: ...@@ -151,8 +151,11 @@ template = inline:
#!/bin/bash #!/bin/bash
. {{environment}} . {{environment}}
# shut down postgres # shut down postgres
backup_dir={{backup_dir}} if [ ! -d "$1" ]; then
[ -n "$1" ] && backup_dir="$1" echo "Usage: postgres-restore [directory]"
exit 10
fi
backup_dir="$1"
$${directories:bin}/postgres-stop $${directories:bin}/postgres-stop
# check that postgres is down or refuse to run # check that postgres is down or refuse to run
$${directories:bin}/postgres-status | grep STOPPED || exit 10 $${directories:bin}/postgres-status | grep STOPPED || exit 10
......
...@@ -266,7 +266,7 @@ mode = 0644 ...@@ -266,7 +266,7 @@ mode = 0644
recipe = slapos.recipe.template recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance-postgres.cfg.in url = ${:_profile_base_location_}/instance-postgres.cfg.in
output = ${buildout:directory}/instance-postgres.cfg output = ${buildout:directory}/instance-postgres.cfg
md5sum = e2bcc3dafdfc5bf331b743952ed98be2 md5sum = a138dad1b1da2e3f1e6012f4baf69a9d
mode = 0644 mode = 0644
[instance-redis] [instance-redis]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment