查看Linux启动的所有crontab:crontab -l
编辑crontab:crontab -e
#!/bin/sh
export LANG=zh_CN
export WEB_HOME=/webhome#find [dir] -path "[dir]" -prune -o -mmin +1 -type f | xargs rm -f
find ${WEB_HOME}/backup_logs/jsmcc/js8001 -mtime +3 | xargs rm -rf
sleep 2find ${WEB_HOME}/backup_logs/jsmcc/js8002 -mtime +3 | xargs rm -rf
sleep 2find ${WEB_HOME}/backup_logs/monitor -mtime +3 | xargs rm -rf
sleep 2#删除过期的调试日志文件,仅保留3天
find ${WEB_HOME}/logs/jsDebug -mtime +3 ! -name '*.log' -type f | xargs rm -rf
sleep 2#删除SQLLOAD执行的日志文件,仅保留最近3天
#find ${WEB_HOME}/deploy/LoadLogFile/Log -mtime +3 | xargs rm -rf
#sleep 2#删除过期的程序包,仅保留最近7天
find ${WEB_HOME}/deploy -mtime +7 -name '*.zip' | xargs rm -rf
sleep 2#删除WebLogic域产生的日志文件
find ${WEB_HOME}/Oracle/Middleware/user_projects/domains/Admin_domain/servers/AdminServer/logs ! -name '*.log' -type f | xargs rm -rf
sleep 2find ${WEB_HOME}/Oracle/Middleware/user_projects/domains/Admin_domain/servers/Managed_8001/logs ! -name '*.log' -type f | xargs rm -rf
sleep 2find ${WEB_HOME}/Oracle/Middleware/user_projects/domains/Admin_domain/servers/Managed_8002/logs ! -name '*.log' -type f | xargs rm -rf
sleep 2