红联Linux门户
Linux帮助

这个文件为什么执行会出错呢?

发布时间:2009-10-05 19:06:25来源:红联作者:hchvip
在usr/local/bin下建立一个backups.sh里面输入如下代码
#!/bin/sh
#
#
#This script takes one parameter,the dump level.
#If the dump level is not provided,it is
#automatically set to zero.For level zero (full).
#dumps,rewind and eject the tape when done.
#
if [ $ ];then
level=$1
else
#
#No dump level was provided,so set it
#to zero
#
level="0"
fi

/sbin/dump $level 'uf' /bakup/nbackup /
/sbin/dump $level 'uf' /bakup/nbackup /home
/sbin/dump $level 'uf' /bakup/nbackup /var
/sbin/dump $level 'uf' /bakup/nbackup /usr
#
#If we are doing a full dump,rewind and eject
#the tape when done.
#
if [ $level = "0" ]; then
/bin/mt -f /bakup/nbackup rewind
/bin/mt -f /bakup/nbackup offline
fi
用root执行对系统进行备份,每次都是提示28L有什么错误。怎么回事呢
还有,如果想备份fedora系统该怎么办呢,我是个新手
谢谢
文章评论

共有 2 条评论

  1. hchvip 于 2009-10-05 19:24:06发表:

    明白了,if [ $level = "0" ]; then少个个[]谢谢你

  2. yiyepianzhou 于 2009-10-05 19:10:58发表:

    28L?说的是第28行有错吧,你仔细看看
    备份的话,打个tar包就应该可以了,我没试过,你上网查一下