find笔记

-ok 会增加提示环节 -perm根据权限进行查找

[root@sina-vmallservice-bridge-228-20-163 ~]# find tmp/ ! -perm 777 -ok chmod -R 777 {} \;
< chmod ... tmp/ > ? y

[root@sina-vmallservice-nginx-front-228-200-33 data]#  find /data/apollo ! -perm 777  -exec chmod -R 777 {} \;

find /data/ae ! -perm 777 -exec chmod -R 777 {} \;
find /data/ams ! -perm 777 -exec chmod -R 777 {} \;
find /data/apollo* ! -perm 777 -exec chmod -R 777 {} \;

find /data/honor ! -perm 777 -exec chmod -R 777 {} \;
find /data/huawei ! -perm 777 -exec chmod -R 777 {} \;
find /data/in* ! -perm 777 -exec chmod -R 777 {} \;

find /data/mx ! -perm 777 -exec chmod -R 777 {} \;
find /data/my ! -perm 777 -exec chmod -R 777 {} \;
find /data/portal ! -perm 777 -exec chmod -R 777 {} \;

find /data/nasdir ! -perm 777 -exec chmod -R 777 {} \;
find /data/pms ! -perm 777 -exec chmod -R 777 {} \;
find /data/pts ! -perm 777 -exec chmod -R 777 {} \;
find /data/sa ! -perm 777 -exec chmod -R 777 {} \;
find /data/ssc ! -perm 777 -exec chmod -R 777 {} \;
find /data/vmall ! -perm 777 -exec chmod -R 777 {} \;


*/10 * * * * find /data/ae ! -perm 777 -exec chmod -R 777 {} \; > /dev/null 2>&1 &
*/10 * * * * find /data/ae ! -perm 777 -exec chmod -R 777 {} \; > /dev/null 2>&1 &
*/10 * * * * find /data/ams ! -perm 777 -exec chmod -R 777 {} \; > /dev/null 2>&1 &
*/10 * * * * find /data/apollo* ! -perm 777 -exec chmod -R 777 {} \; > /dev/null 2>&1 &

*/5 * * * * find /data/honor ! -perm 777 -exec chmod -R 777 {} \;
*/6 * * * * find /data/huawei ! -perm 777 -exec chmod -R 777 {} \;
*/7 * * * * find /data/in* ! -perm 777 -exec chmod -R 777 {} \;

*/5 * * * * find /data/mx ! -perm 777 -exec chmod -R 777 {} \;
*/6 * * * * find /data/my ! -perm 777 -exec chmod -R 777 {} \;
*/7 * * * * find /data/portal ! -perm 777 -exec chmod -R 777 {} \;
   
*/10 * * * * find /data/nasdir ! -perm 777 -exec chmod -R 777 {} \; > /dev/null 2>&1 &
*/10 * * * * find /data/pms ! -perm 777 -exec chmod -R 777 {} \; > /dev/null 2>&1 &
*/10 * * * * find /data/pts ! -perm 777 -exec chmod -R 777 {} \; > /dev/null 2>&1 &
*/10 * * * * find /data/sa ! -perm 777 -exec chmod -R 777 {} \; > /dev/null 2>&1 &
*/10 * * * * find /data/ssc ! -perm 777 -exec chmod -R 777 {} \; > /dev/null 2>&1 &
*/10 * * * * find /data/vmall ! -perm 777 -exec chmod -R 777 {} \; > /dev/null 2>&1 &


find /data/ae ! -perm 777
find /data/ams ! -perm 777
find /data/apollo* ! -perm 777
find /data/honor ! -perm 777
find /data/huawei ! -perm 777
find /data/in* ! -perm 777
find /data/mx ! -perm 777
find /data/my ! -perm 777
find /data/nasdir ! -perm 777
find /data/pms ! -perm 777
find /data/portal ! -perm 777
find /data/pts ! -perm 777
find /data/sa ! -perm 777
find /data/ssc ! -perm 777
find /data/vmall ! -perm 777

删除大于10分钟的文件

find /logs/eop-ot-service/eop-ot-service-*/archive/  -maxdepth 3 -mindepth 3 -type f  -not -newermt `date -d "-10 minutes" '+%Y-%m-%dT%H:%M:%S'` -exec rm -rf {} \;

find /logs/eop-ot-service/eop-ot-service-*/archive/ -type f  -not -newermt `date -d "-10 minutes" '+%Y-%m-%dT%H:%M:%S'` -exec rm -rf {} \;
find /logs/eop-ot-service/eop-ot-service-*/backup/ -type f  -not -newermt `date -d "-10 minutes" '+%Y-%m-%dT%H:%M:%S'` -exec rm -rf {} \;

可以查看超过十分钟的文件的具体信息 时间

find /logs/eop-ot-service/eop-ot-service-*/archive/ -type f  -not -newermt `date -d "-10 minutes" '+%Y-%m-%dT%H:%M:%S'` -ls

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值