From: parmentelat Date: Fri, 7 Dec 2018 11:41:05 +0000 (+0100) Subject: print out message during the initial rsync when migrating X-Git-Tag: py3ok~24 X-Git-Url: http://git.onelab.eu/?p=build.git;a=commitdiff_plain;h=77cf7bccd1980c4fb1208a730e4ad53382c16274 print out message during the initial rsync when migrating --- diff --git a/lbuild-initvm.sh b/lbuild-initvm.sh index ce220133..636fdc4f 100755 --- a/lbuild-initvm.sh +++ b/lbuild-initvm.sh @@ -868,6 +868,8 @@ function main () { local lxc_root=$(lxcroot $lxc) # rainchecks + # when using with the -i option, checking that $lxc_root is void + # is a little too much stress.. almost_empty $lxc_root || \ { echo "container $lxc already exists in $lxc_root - exiting" ; exit 1 ; } virsh -c lxc:/// domuuid $lxc >& /dev/null && \ @@ -876,9 +878,13 @@ function main () { # if IMAGE, copy the provided rootfs to lxc_root if [ -n "$IMAGE" ] ; then - [ ! -d "$IMAGE" ] && \ - { echo "$IMAGE rootfs folder does not exist - exiting" ; exit 1 ; } - rsync -a $IMAGE/ $lxc_root/ + if [ ! -d "$IMAGE" ]; then + echo "$IMAGE rootfs folder does not exist - exiting" + exit 1 + else + echo "Copying $IMAGE into $lxc_root with rsync --archive --delete" + rsync --archive --delete $IMAGE/ $lxc_root/ + fi fi # check we've exhausted the arguments