How to add a cron job to VMware ESXi 5.x

Here is a quick way that you can add a cron job in ESXi 5.x. You will notice that there are already jobs in here that run on a schedule by default, the last line is new.

Edit the below file:
vi /var/spool/cron/crontabs/root

The last line in the below file will run at 12:01AM UTC time and will delete any file that ends with .trp in the /var/spool/snmp folder.
Contents of the “root” file:
————-
#min hour day mon dow command
1 1 * * * /sbin/tmpwatch.py
1 * * * * /sbin/auto-backup.sh
0 * * * * /usr/lib/vmware/vmksummary/log-heartbeat.py
*/5 * * * * /sbin/hostd-probe
1 0 * * * for i in /var/spool/snmp/*.trp; do rm -rf $i; done
————-

SPONSOR:

This entry was posted in Linux, Scripting, VMware and tagged , , , . Bookmark the permalink.

Comments are closed.