|
先输入 crontab -e
按 i 插入字符
* * * * * find /mhzx/auany/xbackup/* -mmin +360 -exec rm -rf {} \;
* * * * * find /mhzx/mhzx_4095/uniqname/uqxbackup/* -mmin +360 -exec rm -rf {} \;
* * * * * find /data/home/user00/ -name "*.*" -mmin +360 -exec rm -rf {} \;
* * * * * find /mhzx/mhzx_4095/uniqname/uqxdb/ -name "*.log" -mmin +360 -exec rm -rf {} \;
* * * * * find /mhzx/mhzx_4095/gs/xdb/ -name "*.log" -mmin +360 -exec rm -rf {} \;
* * * * * find /mhzx/auany/logs/ -name "*.log" -mmin +360 -exec rm -rf {} \;
* * * * * find /mhzx/auany/logs/ -name "*.log.*" -mmin +360 -exec rm -rf {} \;
* * * * * find /mhzx/matcher/logs/ -name "*.log" -mmin +360 -exec rm -rf {} \;
* * * * * find /mhzx/matcher/logs/ -name "*.log.*" -mmin +360 -exec rm -rf {} \;
* * * * * find /mhzx/zdir/android/logs/ -name "*.log" -mmin +360 -exec rm -rf {} \;
* * * * * find /mhzx/zdir/ios/logs/ -name "*.log" -mmin +360 -exec rm -rf {} \;
* * * * * find /mhzx/mhzx_4002/uniqname/uqxdb/ -name "*.log" -mmin +360 -exec rm -rf {} \;
* * * * * find /mhzx/mhzx_4002/gs/xdb/ -name "*.log" -mmin +360 -exec rm -rf {} \;
* * * * * find /mhzx/mhzx_4002/uniqname/uqxbackup/* -mmin +360 -exec rm -rf {} \;
此文件会自动删除6小时前的日志信息,和xdb备份文件。可以自己调整+360的时间。
查看crontab服务状态:service crond status
/sbin/service crond start //启动服务
/sbin/service crond stop //关闭服务
/sbin/service crond restart //重启服务
/sbin/service crond reload //重新载入配置
加入开机自动启动:
chkconfig crond on
by:一阵风
QQ:436043762
|
|