contab -e
10 */12 * * * sh /usr/local/apache2/htdocs/cakephp/ebook/webroot/php/delete_big_log.sh
代码:
#!/bin/bash
location=’/var/spool/mail’
find $location -type f -name ‘root’ | xargs rm -f
location=”/var/log/”
find $location -type f -name ‘lsyncd.log’ |xargs rm -f
location=”/usr/local/apache2/htdocs/cakephp/ebook/tmp/logs/”
find $location -type f -name ‘debug.log’ |xargs rm -f
find $location -type f -name ‘error.log’ |xargs rm -f
location=”/usr/local/apache2/htdocs/cakephp/channel/tmp/logs/”
find $location -type f -name ‘debug.log’ |xargs rm -f
find $location -type f -name ‘error.log’ |xargs rm -f
location=”/usr/local/apache2/htdocs/cakephp/client_channel/tmp/logs/”
find $location -type f -name ‘debug.log’ |xargs rm -f
find $location -type f -name ‘error.log’ |xargs rm -f
location=”/usr/local/apache2/logs/”
find $location -mtime +3 -type f |xargs rm -f
find $location -mtime +3 -type f |xargs rm -f