|
@ -1773,8 +1773,9 @@ cmdline.spec.gnu dump |
|
|
cmdline.spec:odoo:cmd:dump:run() { |
|
|
cmdline.spec:odoo:cmd:dump:run() { |
|
|
|
|
|
|
|
|
: :posarg: DUMP_ZIPFILE 'Target path to store odoo dump zip file.' |
|
|
: :posarg: DUMP_ZIPFILE 'Target path to store odoo dump zip file.' |
|
|
: :optval: --database,-d 'Target database (default if not specified)' |
|
|
|
|
|
|
|
|
: :optval: --database,-D 'Target database (default if not specified)' |
|
|
: :optval: --service,-s "The service (defaults to 'odoo')" |
|
|
: :optval: --service,-s "The service (defaults to 'odoo')" |
|
|
|
|
|
: :optfla: --debug,-d "Display debugging information" |
|
|
|
|
|
|
|
|
odoo_service="${opt_service:-odoo}" |
|
|
odoo_service="${opt_service:-odoo}" |
|
|
|
|
|
|
|
@ -1782,8 +1783,16 @@ cmdline.spec:odoo:cmd:dump:run() { |
|
|
|
|
|
|
|
|
msg_dbname=default |
|
|
msg_dbname=default |
|
|
[ -n "$opt_database" ] && msg_dbname="'$opt_database'" |
|
|
[ -n "$opt_database" ] && msg_dbname="'$opt_database'" |
|
|
compose --no-hooks save "$odoo_service" $opt_database > "$DUMP_ZIPFILE" || { |
|
|
|
|
|
err "Error dumping ${DARKYELLOW}$odoo_service${NORMAL}'s $msg_dbname database to '$DUMP_ZIPFILE'." |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
opts_compose=() |
|
|
|
|
|
[ -t 1 ] && opts_compose+=("--color") |
|
|
|
|
|
[ "$opt_debug" ] && { |
|
|
|
|
|
VERBOSE=1 |
|
|
|
|
|
opts_compose+=("--debug") |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
compose --no-hooks "${opts_compose[@]}" save "$odoo_service" $opt_database > "$DUMP_ZIPFILE" || { |
|
|
|
|
|
err "Failed dumping ${DARKYELLOW}$odoo_service${NORMAL}'s $msg_dbname database to '$DUMP_ZIPFILE'." |
|
|
exit 1 |
|
|
exit 1 |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|