#!/bin/sh
if [ $# != 2 ]; then
echo "Usage: $0 device dest"
echo "E.g. $0 hda
/mnt/usb/linux-debian5-disk-v1.0-"
exit 0
fi
DISK=$1
NAME=$2
cd /
mkdir ${DISK}1
mount /dev/${DISK}1 /${DISK}1 || exit 0
cd /${DISK}1
tar zcvf ${NAME}1.tgz *
cd /
umount /dev/${DISK}1
rm -rf /${DISK}1
cd /
mkdir ${DISK}2
mount /dev/${DISK}2 /${DISK}2 || exit 0
cd /${DISK}2
tar zcvf ${NAME}2.tgz *
cd /
umount /dev/${DISK}2
rm -rf /${DISK}2
阅读(973) | 评论(0) | 转发(0) |