Quantcast
Channel: VMware Communities : Popular Discussions - VMware Server 1
Viewing all articles
Browse latest Browse all 74849

Bash backup script

$
0
0

I have been tweaking a script to backup VM's for a couple of months now. Attached is a copy of where i am at currently with it. Our Host is running Ubuntu 6.06LTS. Since this is a Bash script it should be portable to most flavors of Linux.

 

The script does the following:

 

1). Gathers a list of registered VM's.

2). Checks current state of VM, if it is off or suspended, the VM is skipped.

3). Checks the directory of the VM for a file called "daily" (this is an empty file, it is just used so you can selectivle back machines up). If it does not exist the machine is skipped.

4). If the VM meets the above criteria, it is suspended.

5). After suspended the machine is archived and compressed.

6). The machine is then started back up.

7). The PID of the VM is identified, and a nice value is assigned.(The nice values are stored in a seperate file. Format of the file is VMname.vmx NiceValue.

 

It only keeps the previous days archives, as i back them up to tape daily. It logs all of its output to a user specified location, and keeps 7 days worth of log files. If there are any VMware-server logs that are in excess of 7 days it culls those as well.

 

Any feedback is greatly appreciated.


Viewing all articles
Browse latest Browse all 74849

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>