Tuesday, March 9, 2010

ESXi and Cron

Many people say ESXi doesn't come with cron.
Well, that is not necessarily the case.
A cron table for the user root is located under /var/spool/cron/crontabs/root.
The way to do it is the dirty way : through vi.

NOTE : Most likely, this crontab is automatically deleted on shutdown.
This has not been tested, but it is likely to work. IF somebody manages to test it, please let me know.
You probably want to keep a copy of it in the /bootbank/oem.tgz archive. Note also that the OEM tgz gets decompressed at root level, which means you also have to compress the full path to your files. Decompress the archive to a temporary directory (say, /tmp/oemarch/), create the same directory path (/var/spool/cron/crontabs) under this temp dir and copy the crontab ("root") from the /var/spool/cron/crontabs location to this new temp folder. Recompress everything and replace the old oem.tgz archive with this new one.

No comments: