Home > it > VMware ESXi: initiating backup script from another server

VMware ESXi: initiating backup script from another server

Because of the lack of the cronjobs in ESXi, a regular run of a script like backup the virtual machines is not possible without a second system. I use a linux to initiate the backup script located on the esx datastore.

Take the following steps:
1) create a keybundle on the linux server without passphrase

ssh-keygen -t dsa

2) copy the id_dsa.pub to the esxi server

scp /root/.ssh/id_dsa.pub root@IP_ESXi:/.ssh/authorized_keys

3) at the first login, the key has to be accepted. the second one should work then.

ssh IP_ESXi

4) create a new file which includes the execution command

vi esx-backup.sh
#!/bin/bash
ssh IP_ESXi '/vmfs/volumes/datastore1/ghettoVCB.sh /vmfs/volumes/datastore1/vmlist' 2&>1 /backup/ESXi.log

5) create a new cronjob

crontab -e

6) esxi will remove the .ssh directory after a reboot, so read my post before how to workaround this issue.

Categories: it Tags:
  1. No comments yet.
  1. No trackbacks yet.

Spam protection by WP Captcha-Free