export2tar recipe
authorRichard Jones <rjones@redhat.com>
Sat, 25 Apr 2009 11:36:45 +0000 (12:36 +0100)
committerRichard Jones <rjones@redhat.com>
Sat, 25 Apr 2009 11:36:45 +0000 (12:36 +0100)
recipes/export2tar.example [new file with mode: 0644]
recipes/export2tar.html [new file with mode: 0644]
recipes/export2tar.sh [new file with mode: 0755]

diff --git a/recipes/export2tar.example b/recipes/export2tar.example
new file mode 100644 (file)
index 0000000..47033c8
--- /dev/null
@@ -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 (file)
index 0000000..8dc07ca
--- /dev/null
@@ -0,0 +1,16 @@
+<h2>Export the /home directory from a virtual machine into a tarball</h2>
+
+<p>
+This script lets you export any directory you like from a virtual
+machine as a tarball.  For example, to export <code>/home</code>
+from a standard Fedora or RHEL virtual machine you would do:
+</p>
+
+<pre>
+export2tar guest.img /dev/VolGroup00/LogVol00 /home home.tar.gz
+</pre>
+
+<p>
+<code>/dev/VolGroup00/LogVol00</code> is the partition or LV <i>inside</i>
+the VM which contains the directory you want.
+</p>
diff --git a/recipes/export2tar.sh b/recipes/export2tar.sh
new file mode 100755 (executable)
index 0000000..43860bd
--- /dev/null
@@ -0,0 +1,3 @@
+#!/bin/sh -
+
+guestfish -a "$1" -m "$2" tgz-out "$3" "$4"