«

»

Simple backup script for VMWare Workstation.

There are more sophisticated ways of doing this, but here is a simple script I’m using to backup my virtual machines. It runs out of cron at 3am on Sundays. I also take snapshots of the VM before any major change.

#!/bin/bash

echo "BACKUP Virtual Machines Initiated"
echo "Suspending running VMs"
vmrun -T ws suspend "/datastore/Virtual Machines/Windows 7 x64/Windows 7 x64.vmx"
echo "Copying VMDKs"
rsync -az "/datastore/Virtual Machines/Windows 7 x64" "/backup/Virtual Machines"
echo "Restarting suspended VMs"
vmrun -T ws start "/datastore/Virtual Machines/Windows 7 x64/Windows 7 x64.vmx"
echo "Complete"

Permanent link to this article: http://www.lukemacneil.com/2009/12/10/simple-backup-script-for-vmware-workstation/

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>