From a057a058e72d0949db4140e9a03b7a0e5b3c823c Mon Sep 17 00:00:00 2001 From: Richard Jones Date: Sat, 25 Apr 2009 12:36:45 +0100 Subject: [PATCH] export2tar recipe --- recipes/export2tar.example | 14 ++++++++++++++ recipes/export2tar.html | 16 ++++++++++++++++ recipes/export2tar.sh | 3 +++ 3 files changed, 33 insertions(+) create mode 100644 recipes/export2tar.example create mode 100644 recipes/export2tar.html create mode 100755 recipes/export2tar.sh diff --git a/recipes/export2tar.example b/recipes/export2tar.example new file mode 100644 index 0000000..47033c8 --- /dev/null +++ b/recipes/export2tar.example @@ -0,0 +1,14 @@ +$ ./export2tar.sh /dev/mapper/Guests-RHEL53PV32 /dev/VolGroup00/LogVol00 \ + /home /tmp/home.tar.gz +$ ll /tmp/home.tar.gz +-rw-rw-r--. 1 rjones rjones 824 2009-04-25 12:33 /tmp/home.tar.gz +$ tar ztf /tmp/home.tar.gz +./ +./rjones/ +./rjones/.bash_profile +./rjones/.mozilla/ +./rjones/.mozilla/extensions/ +./rjones/.mozilla/plugins/ +./rjones/.bash_logout +./rjones/.bashrc +./rjones/.emacs diff --git a/recipes/export2tar.html b/recipes/export2tar.html new file mode 100644 index 0000000..8dc07ca --- /dev/null +++ b/recipes/export2tar.html @@ -0,0 +1,16 @@ +

Export the /home directory from a virtual machine into a tarball

+ +

+This script lets you export any directory you like from a virtual +machine as a tarball. For example, to export /home +from a standard Fedora or RHEL virtual machine you would do: +

+ +
+export2tar guest.img /dev/VolGroup00/LogVol00 /home home.tar.gz
+
+ +

+/dev/VolGroup00/LogVol00 is the partition or LV inside +the VM which contains the directory you want. +

diff --git a/recipes/export2tar.sh b/recipes/export2tar.sh new file mode 100755 index 0000000..43860bd --- /dev/null +++ b/recipes/export2tar.sh @@ -0,0 +1,3 @@ +#!/bin/sh - + +guestfish -a "$1" -m "$2" tgz-out "$3" "$4" -- 1.8.3.1