mirror of https://github.com/tteck/Proxmox.git
Update hacore2hacore-data.sh
This commit is contained in:
parent
1068827ea0
commit
1eaf803c29
|
@ -81,15 +81,15 @@ if [ $(pct status $CTID_TO | sed 's/.* //') == 'running' ]; then
|
||||||
pct stop $CTID_TO
|
pct stop $CTID_TO
|
||||||
fi
|
fi
|
||||||
msg "Mounting Container Disks..."
|
msg "Mounting Container Disks..."
|
||||||
DOCKER_PATH=/var/lib/docker/volumes/hass_config/_data
|
|
||||||
CORE_PATH=/root/.homeassistant
|
CORE_PATH=/root/.homeassistant
|
||||||
|
CORE_PATH2=/root/
|
||||||
CTID_FROM_PATH=$(pct mount $CTID_FROM | sed -n "s/.*'\(.*\)'/\1/p") ||
|
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}'."
|
die "There was a problem mounting the root disk of LXC '${CTID_FROM}'."
|
||||||
[ -d "${CTID_FROM_PATH}${CORE_PATH}" ] ||
|
[ -d "${CTID_FROM_PATH}${CORE_PATH}" ] ||
|
||||||
die "Home Assistant directories in '$CTID_FROM' not found."
|
die "Home Assistant directories in '$CTID_FROM' not found."
|
||||||
CTID_TO_PATH=$(pct mount $CTID_TO | sed -n "s/.*'\(.*\)'/\1/p") ||
|
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}'."
|
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."
|
die "Home Assistant directories in '$CTID_TO' not found."
|
||||||
|
|
||||||
msg "Copying Data..."
|
msg "Copying Data..."
|
||||||
|
@ -102,7 +102,7 @@ RSYNC_OPTIONS=(
|
||||||
--info=progress2
|
--info=progress2
|
||||||
)
|
)
|
||||||
msg "<======== Docker Data ========>"
|
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"
|
echo -en "\e[1A\e[0K\e[1A\e[0K"
|
||||||
|
|
||||||
info "Successfully Transferred Data."
|
info "Successfully Transferred Data."
|
||||||
|
|
Loading…
Reference in New Issue