Commit 6cf1769d authored by Julien Muchembled's avatar Julien Muchembled

ERP5: fix handling of repozo restoration failure

parent 8b7b0e92
......@@ -78,7 +78,7 @@ md5sum = 6b10ab0c54278156caf058ebb7246645
[template-zeo]
filename = instance-zeo.cfg.in
md5sum = 0ba5735ab87ee53e2c203b1563b55ff0
md5sum = f67c7dac3f3f71b0f1f8c2cfcfc49b29
[template-zodb-base]
filename = instance-zodb-base.cfg.in
......
......@@ -152,18 +152,12 @@ input = inline: #!/bin/sh
exit 1
fi
fi
echo "Removing $zodb_path..."
echo "Restoring $storage_name into $zodb_path..."
$repozo --verify --repository="$zodb_backup_directory/$storage_name"
CURRENT_EXIT_CODE=$?
if [ ! "$CURRENT_EXIT_CODE"="0" ]; then
echo "$storage_name Backup verification failed. Backup data is inconsistent."
exit "$CURRENT_EXIT_CODE"
fi
echo "Restoring $zodb_path..."
$repozo --verify --repository="$zodb_backup_directory/$storage_name" &&
$repozo --recover --output="$zodb_directory/$zodb_path" --repository="$zodb_backup_directory/$storage_name"
CURRENT_EXIT_CODE=$?
if [ ! "$CURRENT_EXIT_CODE"="0" ]; then
EXIT_CODE="$CURRENT_EXIT_CODE"
if [ $CURRENT_EXIT_CODE != 0 ]; then
EXIT_CODE=$CURRENT_EXIT_CODE
echo "$storage_name Backup restoration failed."
fi
{% endfor -%}
......
......@@ -78,7 +78,7 @@ md5sum = 1333d2fc21f64da4010a4eafea59d141
[template-zeo]
filename = instance-zeo.cfg.in
md5sum = 702afb430227eebe4312a618da7ef7cb
md5sum = 6513f1ecd9a2daaf36ca720f15932ae3
[template-zeo-conf]
filename = zeo.conf.in
......
......@@ -203,12 +203,11 @@ inline =
exit 1
fi
fi
echo "Removing $zodb_path..."
echo "Restoring $storage_name into $zodb_path..."
echo "Restoring $zodb_path..."
$repozo --recover --with-verify --output="$zodb_directory/$zodb_path" --repository="$zodb_backup_directory/$storage_name"
CURRENT_EXIT_CODE=$?
if [ ! "$CURRENT_EXIT_CODE"="0" ]; then
EXIT_CODE="$CURRENT_EXIT_CODE"
if [ $CURRENT_EXIT_CODE != 0 ]; then
EXIT_CODE=$CURRENT_EXIT_CODE
echo "$storage_name Backup restoration failed."
fi
{% endfor -%}
......
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