Update hacore2hacore-data.sh

This commit is contained in:
tteckster 2022-11-30 22:03:06 -05:00 committed by GitHub
parent 1068827ea0
commit 1eaf803c29
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -81,15 +81,15 @@ if [ $(pct status $CTID_TO | sed 's/.* //') == 'running' ]; then
pct stop $CTID_TO
fi
msg "Mounting Container Disks..."
DOCKER_PATH=/var/lib/docker/volumes/hass_config/_data
CORE_PATH=/root/.homeassistant
CORE_PATH2=/root/
CTID_FROM_PATH=$(pct mount $CTID_FROM | sed -n "s/.*'\(.*\)'/\1/p") ||
die "There was a problem mounting the root disk of LXC '${CTID_FROM}'."
[ -d "${CTID_FROM_PATH}${CORE_PATH}" ] ||
die "Home Assistant directories in '$CTID_FROM' not found."
CTID_TO_PATH=$(pct mount $CTID_TO | sed -n "s/.*'\(.*\)'/\1/p") ||
die "There was a problem mounting the root disk of LXC '${CTID_TO}'."
[ -d "${CTID_TO_PATH}${CORE_PATH}" ] ||
[ -d "${CTID_TO_PATH}${CORE_PATH2}" ] ||
die "Home Assistant directories in '$CTID_TO' not found."
msg "Copying Data..."
@ -102,7 +102,7 @@ RSYNC_OPTIONS=(
--info=progress2
)
msg "<======== Docker Data ========>"
rsync ${RSYNC_OPTIONS[*]} ${CTID_FROM_PATH}${CORE_PATH} ${CTID_TO_PATH}${CORE_PATH}
rsync ${RSYNC_OPTIONS[*]} ${CTID_FROM_PATH}${CORE_PATH} ${CTID_TO_PATH}${CORE_PATH2}
echo -en "\e[1A\e[0K\e[1A\e[0K"
info "Successfully Transferred Data."