1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-01-08 21:17:43 +03:00

F #1428: Add backup_vms script (#858)

This commit is contained in:
Jan Orel 2021-02-23 10:06:52 +01:00 committed by GitHub
parent 5be625823a
commit 44a5182088
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 0 deletions

View File

@ -700,6 +700,7 @@ INSTALL_FILES=(
INSTALL_GEMS_SHARE_FILES:$SHARE_LOCATION
ONETOKEN_SHARE_FILE:$SHARE_LOCATION
FOLLOWER_CLEANUP_SHARE_FILE:$SHARE_LOCATION
BACKUP_VMS_SHARE_FILE:$SHARE_LOCATION
HOOK_FT_FILES:$VAR_LOCATION/remotes/hooks/ft
HOOK_VCENTER_FILES:$VAR_LOCATION/remotes/hooks/vcenter
HOOK_VCENTER_TMPLS:$VAR_LOCATION/remotes/hooks/vcenter/templates
@ -2096,6 +2097,8 @@ ONETOKEN_SHARE_FILE="share/onetoken/onetoken.sh"
FOLLOWER_CLEANUP_SHARE_FILE="share/hooks/raft/follower_cleanup"
BACKUP_VMS_SHARE_FILE="share/scripts/backup_vms"
#-------------------------------------------------------------------------------
# Start script files, to be installed under $SHARE_LOCATION/start-scripts
#-------------------------------------------------------------------------------

9
share/scripts/backup_vms Executable file
View File

@ -0,0 +1,9 @@
#!/bin/bash
read -r -d '' VMS < <( onevm list --extended -x | \
/var/lib/one/remotes/datastore/xpath.rb --stdin \
%m%/VM_POOL/VM/USER_TEMPLATE/BACKUP/../../ID )
for VM in $VMS; do
onevm backup $VM
done