例子:
删除1个月前/test目录里面的文件
find /test/ -name 'filesname' -mtime +30 -exec rm -f {} \; >> /tmp/clean.log 2>&1
写成一个脚本,加到定时任务,每天跑一次即可
其他用法
把php后缀的文件权限改为644
find /test/ -name “*.php” -exec chmod 644 {} \;
例子:
删除1个月前/test目录里面的文件
find /test/ -name 'filesname' -mtime +30 -exec rm -f {} \; >> /tmp/clean.log 2>&1
写成一个脚本,加到定时任务,每天跑一次即可
其他用法
把php后缀的文件权限改为644
find /test/ -name “*.php” -exec chmod 644 {} \;