|
@ -735,11 +735,6 @@ vps_install_backup() { |
|
|
return 1 |
|
|
return 1 |
|
|
fi |
|
|
fi |
|
|
|
|
|
|
|
|
already_present= |
|
|
|
|
|
if e "$out" | grep "^II Entry for service .* is already present" >/dev/null 2>&1; then |
|
|
|
|
|
already_present=1 |
|
|
|
|
|
info "Backup entry is already present in 'compose.yml' of '$vps'" |
|
|
|
|
|
fi |
|
|
|
|
|
out="${out%$'\n'}" |
|
|
out="${out%$'\n'}" |
|
|
out="${out#*$'\n'}" |
|
|
out="${out#*$'\n'}" |
|
|
key="${out%\'*}" |
|
|
key="${out%\'*}" |
|
@ -753,11 +748,22 @@ vps_install_backup() { |
|
|
return 1 |
|
|
return 1 |
|
|
fi |
|
|
fi |
|
|
|
|
|
|
|
|
if [ "$type" == "compose" ] && [ -z "$already_present" ]; then |
|
|
|
|
|
ssh:run "root@$vps" -- compose --debug up || { |
|
|
|
|
|
err "Command 'compose --debug up' failed." |
|
|
|
|
|
return 1 |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
if [ "$type" == "compose" ]; then |
|
|
|
|
|
if ! ssh:run "root@$vps" -- \ |
|
|
|
|
|
docker exec myc_cron_1 \ |
|
|
|
|
|
cat /etc/cron.d/rsync-backup >/dev/null 2>&1; then |
|
|
|
|
|
ssh:run "root@$vps" -- compose --debug up || { |
|
|
|
|
|
err "Command 'compose --debug up' failed." |
|
|
|
|
|
return 1 |
|
|
|
|
|
} |
|
|
|
|
|
if ! ssh:run "root@$vps" -- \ |
|
|
|
|
|
docker exec myc_cron_1 \ |
|
|
|
|
|
cat /etc/cron.d/rsync-backup >/dev/null 2>&1; then |
|
|
|
|
|
err "Launched 'compose up' successfully but ${YELLOW}cron${NORMAL} container is not setup as expected." |
|
|
|
|
|
echo " Was waiting for existence of '/etc/cron.d/rsync-backup' in it." >&2 |
|
|
|
|
|
return 1 |
|
|
|
|
|
fi |
|
|
|
|
|
fi |
|
|
fi |
|
|
fi |
|
|
|
|
|
|
|
|
dest="$server" |
|
|
dest="$server" |
|
|