码迷,mamicode.com
首页 > 其他好文 > 详细

xenserver snapshot backup根据快照名备份

时间:2016-11-21 20:29:52      阅读:300      评论:0      收藏:0      [点我收藏+]

标签:xenserver snapshot backup

11==----------------根据快照名备份----------------------
#!/bin/sh
backup_date=`date +%Y-%m-%d`
echo backup_date: $backup_date
########更改此处快照名##########
snap_name=2016-06-06
########更改备份目录#########
snap_path_name=/root/zentao_backup

snapshot_uuid=`xe snapshot-list name-label=$snap_name params=uuid --minimal`
snap_vm_uuid=`xe snapshot-param-get uuid=$snapshot_uuid param-name=snapshot-of`
snap_vm_name=`xe vm-list uuid=$snap_vm_uuid params=name-label --minimal`
name_back="$snap_vm_name"_snapshot_$snap_name

#echo $name_back
#echo $snap_path_name

xe template-param-set is-a-template=false ha-always-run=false uuid=$snapshot_uuid
xe vm-export vm=$snapshot_uuid filename=$name_back-$backup_date.xva

本文出自 “11416160” 博客,转载请与作者联系!

xenserver snapshot backup根据快照名备份

标签:xenserver snapshot backup

原文地址:http://11426160.blog.51cto.com/11416160/1875090

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!