fix: corretto script gestione_snapshot.sh

This commit is contained in:
Alessandro Rabiti 2026-01-27 23:38:46 +01:00
parent 7615ad2872
commit 7c3fdea7b8
4 changed files with 26 additions and 4 deletions

19
.bashrc Normal file
View file

@ -0,0 +1,19 @@
# ~/.bashrc: executed by bash(1) for non-login shells.
# Note: PS1 is set in /etc/profile, and the default umask is defined
# in /etc/login.defs. You should not need this unless you want different
# defaults for root.
# PS1='${debian_chroot:+($debian_chroot)}\h:\w\$ '
# umask 022
# You may uncomment the following lines if you want `ls' to be colorized:
# export LS_OPTIONS='--color=auto'
# eval "$(dircolors)"
# alias ls='ls $LS_OPTIONS'
alias ll='ls $LS_OPTIONS -l'
# alias l='ls $LS_OPTIONS -lA'
#
# Some more alias to avoid making mistakes:
# alias rm='rm -i'
# alias cp='cp -i'
# alias mv='mv -i'

View file

@ -1,4 +1,4 @@
export GOVC_URL="https://xxxx.yyyy.zz/"
#export GOVC_URL="https://xxxx.yyyy.zz/"
export GOVC_USERNAME="username"
export GOVC_PASSWORD="password"
export GOVC_INSECURE=1

View file

@ -20,13 +20,15 @@ RUN curl -L -o - "https://github.com/vmware/govmomi/releases/latest/download/gov
# Creo la directory dove importare gli script
RUN mkdir -p /opt/app
COPY .bashrc /root/
# Importo gli script
COPY procedura.sh /opt/app/
COPY create_db_mk3.sql /opt/app/
COPY .govc.env /opt/app/
COPY popola_db_mk3.sh /opt/app/
COPY gestione_snapshot.sh /opt/app/
# Source env e shell interattiva
ENTRYPOINT ["bash", "-c", "source /opt/app/.govc.env && exec bash"]
ENTRYPOINT ["bash", "-c", "cd /opt/app && source /opt/app/.govc.env && exec bash"]
#ENTRYPOINT ["bash", "-c"]

View file

@ -39,6 +39,7 @@ VM_LIST_VCSRA=(
"25001_ftpprod1vm"
"25001_asdevjitsi1vm"
"25001_htprodurls1vm"
"25001_htprodcat1vm"
)
VM_LIST_VCSPR=(
@ -83,7 +84,7 @@ case "$option" in
vars_vm=$(basename "$vars")
# eseguo lo snapshot
govc snapshot.create -dc=$vars_dc -vm=$vars_dc -m=false -q=true -d="$commento" $snapshot_name
govc snapshot.create -dc=$vars_dc -vm=$vars_vm -m=false -q=true -d="$commento" $snapshot_name
done
;;
@ -99,7 +100,7 @@ case "$option" in
vars_vm=$(basename "$vars")
# eseguo lo snapshot
govc snapshot.create -dc=$vars_dc -vm=$vars_dc -m=false -q=true -d="$commento" $snapshot_name
govc snapshot.create -dc=$vars_dc -vm=$vars_vm -m=false -q=true -d="$commento" $snapshot_name
done
;;