VMware Cloud Community
malarie
Contributor
Contributor

Esxi 4.0 and Crontab

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.

0 Kudos
5 Replies
lamw
Community Manager
Community Manager

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:

Twitter: @lamw

VMware Code Central - Scripts/Sample code for Developers and Administrators

VMware Developer Comuunity

If you find this information useful, please award points for "correct" or "helpful".

0 Kudos
malarie
Contributor
Contributor

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

0 Kudos
lamw
Community Manager
Community Manager

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:

Twitter: @lamw

VMware Code Central - Scripts/Sample code for Developers and Administrators

VMware Developer Comuunity

If you find this information useful, please award points for "correct" or "helpful".

0 Kudos
malarie
Contributor
Contributor

Ok, thanks for the quick help. It is apreciated. I will RTFM Smiley Happy

0 Kudos
DSTAVERT
Immortal
Immortal

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.

-- David -- VMware Communities Moderator
0 Kudos