我已经设置了一个 ghettoVCB 脚本来备份三个 VM。
我把它放在 crontab 中但遇到了一个问题。
在我的备份文件夹中,我有 3 个不同的文件夹,每个 VM 一个。
每个文件夹中都有以下文件:
-rw-r--r-- 1 root root 1263 Mar 17 01:51 vm1-2010-03-16--2.gz
-rw-r--r-- 1 root root 1263 Mar 17 00:41 vm1-2010-03-16--3.gz
-rw-r--r-- 1 root root 1261 Mar 18 01:22 vm1-2010-03-17--1.gz
drwxr-xr-x 1 root root 980 Mar 19 23:39 vm1-2010-03-19
问题出在最后一个文件夹。似乎备份过程没有完成。
当我阅读有关该文件夹的日志时,我得到:
2010-03-19 23:00:01 -- info: CONFIG - VM_BACKUP_VOLUME = /vmfs/volumes/datastore1/backup/
2010-03-19 23:00:01 -- info: CONFIG - VM_BACKUP_ROTATION_COUNT = 3
2010-03-19 23:00:01 -- info: CONFIG - DISK_BACKUP_FORMAT = zeroedthick
2010-03-19 23:00:01 -- info: CONFIG - ADAPTER_FORMAT = buslogic
2010-03-19 23:00:01 -- info: CONFIG - POWER_VM_DOWN_BEFORE_BACKUP = 0
2010-03-19 23:00:01 -- info: CONFIG - ENABLE_HARD_POWER_OFF = 0
2010-03-19 23:00:01 -- info: CONFIG - ITER_TO_WAIT_SHUTDOWN = 3
2010-03-19 23:00:01 -- info: CONFIG - POWER_DOWN_TIMEOUT = 5
2010-03-19 23:00:01 -- info: CONFIG - SNAPSHOT_TIMEOUT = 15
2010-03-19 23:00:01 -- info: CONFIG - LOG_LEVEL = info
2010-03-19 23:00:01 -- info: CONFIG - BACKUP_LOG_OUTPUT = stdout
2010-03-19 23:00:01 -- info: CONFIG - VM_SNAPSHOT_MEMORY = 0
2010-03-19 23:00:01 -- info: CONFIG - VM_SNAPSHOT_QUIESCE = 0
2010-03-19 23:00:01 -- info: CONFIG - VMDK_FILES_TO_BACKUP = all
http://...
2010-03-19 23:39:35 -- info: Initiate backup for vm1
2010-03-19 23:39:35 -- info: Creating Snapshot "ghettoVCB-snapshot-2010-03-19" for vm1
Destination disk format: VMFS zeroedthick
Cloning disk '/vmfs/volumes/datastore1/vm1/vm1_1.vmdk'...
^MClone: 0% done.^MClone: 1% done.^MClone: 2% done.^MClone: 3% done.^MClone: 4% done.^MClone: 5% done.^MClone: 6% done.^MClone: 7% done.^MClone: 8% done.^MClone: 9% done.^MClone
Failed to clone disk : The file already exists (39).
Destination disk format: VMFS zeroedthick
Cloning disk '/vmfs/volumes/datastore1/vm1/vm1.vmdk'...
2010-03-20 00:46:20 -- info: Removing snapshot from vm1 ...
one: 7% done.^MClone: 8% done.^MClone: 9% done.^MClone: 10% done.^MClone: 11% done.^MClone: 12% done.^MClone: 13% done.^MClone: 14% done.^MClone: 15% done.^MClone: 16% done.^MCl
2010-03-19 23:51:19 -- info: Removing snapshot from vm1 ...
我无法再运行 ghettoVCB,因为虚拟机有一个尚未删除的快照。我知道如何删除快照,但我不知道为什么 VCB 脚本无法处理虚拟机备份的轮换?
有任何想法吗?
谢谢!
答案1
考虑 Cronjob 常见问题解答这里:
我引用:
重要的提示:通过 cron 自动执行时始终将 ghettoVCB 输出重定向到 /dev/null 和/或日志 [...] 可能会导致 ghettoVCB 在备份过程中停止。
这主要仅影响 ESXi 上的用户,但始终重定向输出是一种很好的做法。
希望有所帮助。