Hi all,
ghettoVCB.sh runs correctly when i execute manually but when i execute like a cron it doesn't run :
crontab -l
32 18 22 1 * /tmp/ghettoVCB.sh /tmp/backup_vms > /tmp/LOG_Backup.log 2>&1
Taking backup snapshot for DACDCU01_BACKUP ... ################
/tmp/ghettoVCB.sh: line 202: vmkfstools: command not found -
> ???????
Removing snapshot from DACDCU01_BACKUP ...
Completed backup for DACDCU01_BACKUP! ####################
Start time: Thu Jan 22 16:33:01 CET 2009
End time: Thu Jan 22 16:33:09 CET 2009
Duration : 8 Seconds
Completed backing up specified Virtual Machines!
What's the mistake?
Tanks a lot .
FYI this was actually fixed few weeks back (check out the change log) and the latest version of the script is available at:
=========================================================================
William Lam
VMware vExpert 2009
VMware ESX/ESXi scripts and resources at:
VMware Code Central - Scripts/Sample code for Developers and Administrators
If you find this information useful, please award points for "correct" or "helpful".
When setting up your cron entry you'll want to specify the full path to "vmkfstools" as you can see the issue is the system is unable to find vmkfstools. You can do a quick search online if you have further questions about setting up a crontab entry.
=========================================================================
--William
Take a look here for more info on the limitations of cron when running scripts.
http://blog.spikesource.com/crontab.htm
as lamw said the easiest way to fix is configure absolute paths in the script.
I see that a lot of Windows users are remotely controlling ghettoVCB with tools like plink to remotely login and fire off the scripts. If one didn't want to use a local cron to do this on the VM host machine, but wanted to have it managed from an external Linux computer, what tools are available in Linux that would allow a remote machine to connect to the SSH shell and remotely fire off the ghettoVCB script?
Myles
My own solution
1-) In the script ghettoVCB.sh there are two lines referencing vmkfstools; Change including the complete path : /usr/sbin/vmkfstools -i. Something like that:
VMDK="$"
/usr/sbin/vmkfstools -i "$/$" -d 2gbsparse "$/$" else /usr/sbin/vmkfstools -i "$/$" "$/$"
fi
done
$ vmsvc/snapshot.remove $ > /dev/null 2>&1
2-) Create the cron:
crontab -e
#Execute backup everyday (monday to friday) at 23:30 reporting a log "LOG_HOT_Backup.log "
30 23 * * 1-5 sh /backup_script/ghettoVCB.sh /backup_script/backup_vms >> /backup_script/LOG_HOT_Backup.log 2>&1
Thanks.
FYI this was actually fixed few weeks back (check out the change log) and the latest version of the script is available at:
=========================================================================
William Lam
VMware vExpert 2009
VMware ESX/ESXi scripts and resources at:
VMware Code Central - Scripts/Sample code for Developers and Administrators
If you find this information useful, please award points for "correct" or "helpful".
Thanks for your information.
I have a question, no one has been able to answer.I run ghettoVCB via cron on my ESXi server and it started running this morning I noticed it is still running (not ghettoVCB). Now I know that it failed because I had snapshots already present however my log file is filling up and it’s not letting me stop the process that is running. I thought it would be ghettoVCB, however it is not ghettoVCB after ps aux | grep ghettoVCB low and behold it doesn’t show up in the output. So I need to know and identify which process is still running the backup syquence and kill it, anyone have any ideas at all?
Thanks,