add snap before update
This commit is contained in:
@@ -6,6 +6,8 @@ BRed='\033[1;31m' # Red
|
||||
BGreen='\033[1;32m' # Green
|
||||
Color_Off='\033[0m' # Text Reset
|
||||
|
||||
TMSTMP=$(date +'%Y%m%d%H%M%S')
|
||||
|
||||
function stop_container() {
|
||||
lxc stop ${1}
|
||||
echo -e $(date) "- ${BGreen}Container ${1} stopped${Color_Off}"
|
||||
@@ -13,6 +15,8 @@ function stop_container() {
|
||||
|
||||
echo $(date) "- Start updating LXC container..."
|
||||
for cont_name in $(lxc list type=container -c n --format csv); do
|
||||
echo $(date) "- Make ${cont_name} container snapshot..."
|
||||
lxc snapshot ${cont_name}
|
||||
echo $(date) "- Updating ${cont_name} container..."
|
||||
Status=$(lxc list type=container -c ns --format csv | grep ${cont_name} | cut -d',' -f 2)
|
||||
if [ "${Status}" == "STOPPED" ]; then
|
||||
|
||||
Reference in New Issue
Block a user