shell 强化1

时间:2020-06-15 15:39:32   收藏:0   阅读:65
#/bin/bash #使用date 取得当前系统时间 d=`date +%F` dir=/tmp/data/logs #判断目录是存在 [ -d $dir ] || mkdir -p $dir echo "$d logs" > $dir/$d.log df -h >> $dir/$d.log find $dir/ -mtime +15 | xargs rm > /dev/null 2>&1
评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!