1,194
社区成员
发帖
与我相关
我的任务
分享
source /etc/profile
find /weblog10/bea/user_projects/log/task/schedule/ -name "*.log" -mtime +7 -exec tar cvf /weblog10/bea/user_projects/log/task/schedule/backup/task-`date "+%y%m%d"`.tar {} \;
find /weblog10/bea/user_projects/log/task/schedule/ -name "*.log" -mtime +7 -exec rm -f {} \;
把以上3行代码保存为 test.sh,依次执行下面两个命令:
chmod +x test.sh
./test.sh
看看是否报错