#!/bin/bash
##################################################
#the program is to copy all log file to user_dir
##################################################
if test -d ~/log
then
findlog=$(locate *.log)
for name in $findlog
do
cp -r $name ~/log
done
fi
s399091619 于 2010-02-13 16:19:57发表:
嗯,这个可以学习一下~
mengjie213 于 2009-12-27 10:29:55发表:
用sudo 也是要先给普通用户 sudo 权限哦
s_iron 于 2009-12-27 09:43:07发表:
以上脚本最好先判断一下有没有root权限,或者sudo后执行脚本
yuanqin 于 2009-12-15 21:37:16发表:
#!/bin/bash
##################################################
#the program is to copy all log file to user_dir
##################################################
if test -d ~/log
then
findlog=$(locate *.log)
for name in $findlog
do
cp -r $name ~/log
done
fi