From: Richard Jones Date: Sat, 25 Apr 2009 11:36:45 +0000 (+0100) Subject: export2tar recipe X-Git-Tag: 1.0.13~20 X-Git-Url: http://git.annexia.org/?p=libguestfs.git;a=commitdiff_plain;h=a057a058e72d0949db4140e9a03b7a0e5b3c823c export2tar recipe --- 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"