VMware Communities
Leedymfg
Contributor
Contributor

Virtual Backup

I am currently deploying workstations with ubuntu 12.04 host OS with VMware Workstation 8 running windows 7 guest inside. I was wondering if there was a way to nightly back up the windows 7 guest each night over the network? or a way of going about this automatically.

Appreciate any input on this thanks.

Lance DeWitt.

IT at Leedy Mfg Co LLC.

Lance DeWitt, IT at Leedy Mfg Co LLC.
0 Kudos
9 Replies
weinstein5
Immortal
Immortal

How do you back up your environment currently?  You could back up the entire VM by backing up the filea that make up the VM from the workstation or is you are using a network based backup install an agent inside the VM and let back up that wau

If you find this or any other answer useful please consider awarding points by marking the answer correct or helpful
0 Kudos
Leedymfg
Contributor
Contributor

Im not currently backing up the VM's at the moment. I would like to create a script of some sort so that at midnight or so(when everyone is gone) that it makes a snapshot of the VM as is then saves it to a network share. Then to only keep a certain amount of snapshots(to save HD space). Hope this helps clear a few things up.

Thanks for the responce,

Lance DeWitt.

IT at Leedy Mfg Co LLC.

Lance DeWitt, IT at Leedy Mfg Co LLC.
0 Kudos
Leedymfg
Contributor
Contributor

I was thinking like a script or somthing to "snapshot" the virtuals and put them to a central location. I noticed workstation has the option of snapshot is there a way to automatically snapshot every night?

Lance DeWitt, IT at Leedy Mfg Co LLC.
0 Kudos
Scorpion99
Enthusiast
Enthusiast

you can use the Backup and Restore located in windows 7 to backup your data and use the Task scheduler to schedule it every night on a certain time.

0 Kudos
Tsjo
Enthusiast
Enthusiast

This might work, add this as a cron job and generate a key file for the bkuser.

#!/bin/sh
VMDIR=~/vmware
BKDIR=~/vmbackup
BKSERVER="127.0.0.1"
BKUSER="vmbackup"
BKKEY="/home/$BKUSER/.ssh/id_rsa"

DFORMAT=`date +"%y%m%d%H%M"`
LIFETIME=10

for vm in `ls -1 $VMDIR`; do
    echo "Compressing and copying $vm ..."
    tar -jcf $BKDIR/$vm.$DFORMAT.tar.bz2 $VMDIR/$vm
done

echo "Removing files in folder $BKDIR older than $LIFETIME days"
find $BKDIR/ -mtime +$LIFETIME -delete

for vmbk in `ls -1 $BKDIR`; do
    echo "Sending $vmbk to $bkserver ..."
    scp -i $BKKEY $BKDIR/$vmbk $BKUSER@$BKSERVER:
done

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

Im new to linux, whats a cron job and how do i generate a key file for the bkuser? (also guessing bkuser is the name of the account thats loged in?)

Lance DeWitt, IT at Leedy Mfg Co LLC.
0 Kudos
Leedymfg
Contributor
Contributor

Bump for the weekend.

Lance DeWitt, IT at Leedy Mfg Co LLC.
0 Kudos
WoodyZ
Immortal
Immortal

From your signature obviously you're in IT, although it doesn't say in what capacity, nonetheless why have you not gone to Google and typed in ubuntu cron and review the top hit, CronHowto - Community Ubuntu Documentation!?  You are an IT professional, are you not?

0 Kudos
Leedymfg
Contributor
Contributor

Guess i should have been more specific inside my signature: "Microsoft IT Professional". Thanks for the curtesy. Anyways thanks for the link i guess i thought it was a command specific to what i was asking for, ie; ubuntu backup. Never the less you are right, should have searched for it before.

Lance DeWitt, IT at Leedy Mfg Co LLC.
0 Kudos