The website log is regularly cleaned and backed up every day, and the log script is retained for 10 days
#!/ bin/bash #echo "/www/wwwlogs" #0 0 * * * /www/log.sh >/dev/null 2>&1 Dir=/www/wwwlogs time=`date +%Y%m%d%H%M%S` mkdir -p $Dir/${time}/ mv $Dir/*.log $Dir/${time}/ time=`date +%Y%m%d%H%M%S -d "10 day ago"` for subdir in `ls $Dir`; do if [ "${subdir}" \< "${time}" ]; then rm -rf $Dir/$subdir >/dev/null fi done