Browse Source

new: [vps] make ``vps odoo {dump|restore} ..`` aware of invalid ZIP files

master
Valentin Lab 3 weeks ago
parent
commit
d70b34cd0f
  1. 18
      bin/vps

18
bin/vps

@ -1709,6 +1709,16 @@ cmdline.spec:odoo:cmd:restore:run() {
exit 1 exit 1
} }
if ! out=$(zip -T "$ZIP_DUMP_LOCATION" 2>&1); then
err "Dump file to restore is an invalid zip file."
if [ "$opt_debug" ]; then
printf "%s" "$out" | prefix " ${GRAY}|${NORMAL} " >&2
else
echo " Use \`\`--debug\`\` (or \`\`-d\`\`) to get more information." >&2
fi
exit 1
fi
opts_compose=() opts_compose=()
[ -t 1 ] && opts_compose+=("--color") [ -t 1 ] && opts_compose+=("--color")
[ "$opt_debug" ] && { [ "$opt_debug" ] && {
@ -1775,6 +1785,14 @@ cmdline.spec:odoo:cmd:dump:run() {
exit 1 exit 1
} }
if ! zip -T "$DUMP_ZIPFILE" >/dev/null; then
err "Dump produced an invalid zip file '$DUMP_ZIPFILE'. Deleting it."
echo " Note: if the database is too big, you may want to check that the" >&2
echo " \`limit-time-*' parameters are not set to low." >&2
rm -f "$DUMP_ZIPFILE"
exit 1
fi
info "Successfully dumped ${DARKYELLOW}$odoo_service${NORMAL}'s $msg_dbname database to '$DUMP_ZIPFILE'." info "Successfully dumped ${DARKYELLOW}$odoo_service${NORMAL}'s $msg_dbname database to '$DUMP_ZIPFILE'."
} }

Loading…
Cancel
Save