|
@ -757,13 +757,25 @@ vps_install_backup() { |
|
|
vps_connection_check "$vps" </dev/null || return 1 |
|
|
vps_connection_check "$vps" </dev/null || return 1 |
|
|
|
|
|
|
|
|
read-0 admin server |
|
|
read-0 admin server |
|
|
if ! type=$(ssh:run "root@$vps" -- vps get-type); then |
|
|
|
|
|
|
|
|
if ! type=$(ssh:run "root@$vps" -- vps get-type </dev/null); then |
|
|
err "Could not get type." |
|
|
err "Could not get type." |
|
|
return 1 |
|
|
return 1 |
|
|
fi |
|
|
fi |
|
|
|
|
|
|
|
|
if ! out=$(ssh:run "root@$vps" -- vps install backup "$server" 2>&1); then |
|
|
|
|
|
err "Command 'vps install backup $server' on $vps failed:" |
|
|
|
|
|
|
|
|
backup_opts=() |
|
|
|
|
|
local opt |
|
|
|
|
|
while read-0 opt; do |
|
|
|
|
|
case "$opt" in |
|
|
|
|
|
--ignore-domain-check|--ignore-ping-check) |
|
|
|
|
|
backup_opts+=("$opt") |
|
|
|
|
|
;; |
|
|
|
|
|
*) |
|
|
|
|
|
err "Unknown option '$opt'." |
|
|
|
|
|
return 1 |
|
|
|
|
|
;; |
|
|
|
|
|
esac |
|
|
|
|
|
done |
|
|
|
|
|
if ! out=$(ssh:run "root@$vps" -- vps install backup "$server" "${backup_opts[@]}" 2>&1); then |
|
|
|
|
|
err "Command 'vps install backup $server ${backup_opts[@]}' on $vps failed:" |
|
|
echo "$out" | prefix " ${DARKGRAY}|${NORMAL} " >&2 |
|
|
echo "$out" | prefix " ${DARKGRAY}|${NORMAL} " >&2 |
|
|
return 1 |
|
|
return 1 |
|
|
fi |
|
|
fi |
|
@ -1072,6 +1084,11 @@ cmdline.spec:vps-install:cmd:backup:run() { |
|
|
|
|
|
|
|
|
: :posarg: BACKUP_TARGET 'Backup target. |
|
|
: :posarg: BACKUP_TARGET 'Backup target. |
|
|
(ie: myadmin@backup.domain.org:10023/256)' |
|
|
(ie: myadmin@backup.domain.org:10023/256)' |
|
|
|
|
|
: :optfla: --ignore-domain-check \ |
|
|
|
|
|
"Allow to bypass the domain check in |
|
|
|
|
|
compose file (only used in compose |
|
|
|
|
|
installation)." |
|
|
|
|
|
: :optfla: --ignore-ping-check "Allow to bypass the ping check of host." |
|
|
: :posarg: [VPS...] 'Target host(s) to check' |
|
|
: :posarg: [VPS...] 'Target host(s) to check' |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -1088,7 +1105,15 @@ cmdline.spec:vps-install:cmd:backup:run() { |
|
|
|
|
|
|
|
|
admin=${BACKUP_TARGET%%@*} |
|
|
admin=${BACKUP_TARGET%%@*} |
|
|
server=${BACKUP_TARGET#*@} |
|
|
server=${BACKUP_TARGET#*@} |
|
|
p0 "$admin" "$server" | |
|
|
|
|
|
|
|
|
opts=() |
|
|
|
|
|
|
|
|
|
|
|
[ -n "$opt_ignore_ping_check" ] && |
|
|
|
|
|
opts+=("--ignore-ping-check") |
|
|
|
|
|
|
|
|
|
|
|
[ -n "$opt_ignore_domain_check" ] && |
|
|
|
|
|
opts+=("--ignore-domain-check") |
|
|
|
|
|
|
|
|
|
|
|
p0 "$admin" "$server" "${opts[@]}" | |
|
|
vps_mux vps_install_backup "${VPS[@]}" |
|
|
vps_mux vps_install_backup "${VPS[@]}" |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|