sh vmware_bkp_cli.sh
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了sh vmware_bkp_cli.sh相关的知识,希望对你有一定的参考价值。
#!/bin/sh
# Author: Petr Michalec
# Date: 4.10.2007
# Example usage
# -------------
# Mount external hdd to /mnt/test or other
# Backup configuration:
# tar czvpf /mnt/test/vmbk/backup/VMWARE-bkp-Org-etc-root-home.tar.gz /etc /root /home
# Backup disks:
# ./backup_pemi.sh CLB /mnt/test/vmbk/backup
# Restore:
# cat /mnt/test/backup_dir/clb_disk1.vmdk.gz-* | gunzip > /vmfs/vmhba0:0:0:6/clb_disk1.vmdk
cd '/vmfs/vmhba0:0:0:6'
MASK=$1
DEST=$2
echo -------------------------------------------------
echo I will backup these files to \"$DEST\".
for i in `vmware-cmd -l | grep $MASK` ; do grep vmdk $i | awk -F: '{print $6 }'| sed -e 's/"//g' -e 's/^/ - /' ; done
echo -------------------------------------------------
echo Press ENTER to continue or CTRL+C
read
echo -e "\n\nInfo: You can watch your files with cmd 'watch \"ls -lh $DEST/\"' \n\n"
echo "BackupStart: `date`"
for i in `vmware-cmd -l | grep $MASK` ; do grep vmdk $i | awk -F: '{print $6 }'| sed -e 's/"//g'; done > ~/.toBackup
for i in `cat ~/.toBackup|xargs`; do echo -e "Backuping... $i"; cat $i | gzip | split - -b 1900m $DEST/$i.gz- ;done
echo "BackupEnd: `date`"
以上是关于sh vmware_bkp_cli.sh的主要内容,如果未能解决你的问题,请参考以下文章
如何使我的命令行在具有扩展名(.sh)和名称如“weird.sh.sh.sh”的文件上工作
sh sh_template.sh
sh sh.sh
Linux下面如何运行 SH文件
配置告警系统主脚本main.sh mon.sh load.sh 502.sh disk.sh
shell 脚本各种执行方式(source ./*.sh, . ./*.sh, ./*.sh)的区别