source: MondoRescue/branches/stable/tools/backupqemu@ 1886

Last change on this file since 1886 was 1535, checked in by Bruno Cornec, 17 years ago

Use the configuration files in mondo (begining). That revision doesn't even compile.

  • Property svn:executable set to *
File size: 1.1 KB
Line 
1#!/bin/bash
2#
3# $Id$
4#
5# Test mondo in a virtual machine with qemu
6#
7
8(
9dname=`dirname $0`
10prem=`echo $dname |cut -c1`
11if [ _${prem} = _"/" ]; then
12 export TOOLHOME=$dname
13else
14 export TOOLHOME=${PWD}/$dname
15fi
16
17. $TOOLHOME/common-env
18. $TOOLHOME/distro-env
19. $TOOLHOME/qemu-env
20
21if [ _"$1" = _"" ]; then
22 echo "Syntax: backupqemu vm"
23 exit -1
24else
25 m=$1
26fi
27
28demodir=/home/bruno/demo-mondo
29h=test-mondo
30
31cat > $TMPDIR/test-mondo << EOF
32#!/bin/bash
33
34d=/users/svg
35mkdir -p \$d/images
36mount ${iph}:$demodir \$d/images
37mkdir -p \$d/tmp-$h \$d/scratch-$h
38/usr/sbin/mondoarchive -n ${iph}:$demodir -G -F -N -O -E "/usr/share/doc /usr/src /home /users /var/log" -d images -s 650m -T \$d/tmp-$h -S \$d/scratch-$h -p $h-$m
39umount \$d/images
40EOF
41chmod 755 $TMPDIR/test-mondo
42scp -P $sp $TMPDIR/test-mondo bruno@localhost:
43ssh -p $sp localhost "export PATH=/sbin:/usr/sbin:$PATH ; sudo ./test-mondo"
44
45mkdir -p $demodir/mnt
46sudo mount -o loop $demodir/images/$h-$m-1.iso $demodir/mnt
47sudo cp $demodir/mnt/vmlinuz $demodir/k
48sudo cp $demodir/mnt/initrd.img $demodir/i
49sudo umount $demodir/mnt
50) 2>&1 | tee /tmp/backupqemu.log
Note: See TracBrowser for help on using the repository browser.