Good day,
I have enabled ssh on my ESxi 4.0 box, Now i want to backup my virtual machines using a cronjob with scp. Is it a possible thing to do? crontab does not seem to be installed nor available on esxo 4.0
Thanks.
crontab is not installed but you can still setup a cron entry, take a look at /var/spool/cron/crontabs/root
What you need to keep in mind is by editing this file, the changes will not persist through a reboot, you need to actually have this backed using one of the VMware backup scripts to ensure that changes are kept and persisted.
Take a look at this document and specifically the crontab section, its specific to ghettoVCB.sh but you can apply it to anything relating to setting up a cron entry on ESXi
=========================================================================
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,
Maybe I use /etc/rc.loal to rewrite the script at each reboot?
I can probably just create a script, and put it in /etc/rc.local.d
Nope that will not work, /etc/rc.local is also one of those files that'll need to go through that VMware backup script else the changes will not persist. Please refer to the document in my previous reply for the instructions on how to keep these config change persistent. You can also modify the oem.tgz to keep certain files up to date when ESXi loads: http://www.vm-help.com/esx40i/customize_oem_tgz.php
=========================================================================
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".
Ok, thanks for the quick help. It is apreciated. I will RTFM
rc.local does survive but the oem.tgz is a good idea. I have found crontabs on ESXi hosts to be less than ideal. Consider setting up ssh keys for login.
Then use cron on another VM (the VMA appliance perhaps.) to schedule execution of the ghettoVCB script.