#/bin/bash destIP=192.168.50.2 ct_to copy=$(vzlist |grep 'running' |awk '{print $5}') ct_list=$(echo $ct_to copy |xargs ) ct_count=$(echo $ct_to copy |wc -l ) i=0 echo "START MIGRATE..." for ct in $ct_list; do let "i++" echo "$i из $ct_count CT_NAME $ct" prlctl migrate $ct $destIP --clone --no-compression prlctl stop $ct --kill prlctl set $ct --onboot no ssh $destIP "prlctl start $ct" ssh $destIP "prlctl set $ct --onboot yes" echo "$ct is migrate." # exit 0 done echo "MIGRATE DONE!"