Last active
February 20, 2017 11:00
-
-
Save boina-n/c9351bf1dc145348c17a7d5d6b5038f4 to your computer and use it in GitHub Desktop.
virtualbox snapshot and clone commands
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
rm -rf /opt/application/PCF-DEV/pcfdev/clones/$(date +"%Y%m%d" --date="+2 days ago").pcfdev-v0.389.0 | |
vboxmanage clonevm pcfdev-v0.389.0 --basefolder /opt/application/PCF-DEV/pcfdev/clones/ --name $(date +"%Y%m%d").pcfdev-v0.389.0 | |
# 1. Take a snapshot | |
vboxmanage snapshot pcfdev-v0.389.0 take $(date +"%Y%m%d").pcfdev-v0.389.0 | |
# 2. Clone the Snapshot | |
vboxmanage clonevm pcfdev-v0.389.0 --snapshot $(date +"%Y%m%d").pcfdev-v0.389.0 --basefolder /opt/application/PCF-DEV/pcfdev/clones/ --name $(date +"%Y%m%d").pcfdev-v0.389.0 | |
# 3. Delete the snapshot | |
vboxmanage snapshot pcfdev-v0.389.0 delete $(date +"%Y%m%d").pcfdev-v0.389.0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment