|

楼主 |
发表于 2005-5-11 11:02:52
|
显示全部楼层
Post by genv
[php]
echo -n " lease input backup files name.(e.g:2005_05_08.tar.bz2):"#获得文件名
read $file
if [ -f ./$file ];then#判断文件是否已存在
echo "Sorry! File exist"
exit
else
echo "Backup beging."
tar -cjf $file mnt#无意外备份开始进行
echo "Backup complete!"
echo -n " ress Enter to reboot..."
read
reboot
fi
[/php]
1:无法判断文件是否存在
2:tar 无法压缩提示
tar: Cowardly refusing to create an empty archive
Try `tar --help' for more information.
对不起!十分抱歉,是第2行的read错了,后面不应该跟$
严重道歉
斑竹把它删了吧! |
|