首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > Web前端 >

linux 批量切割web日记shell

2012-09-16 
linux 批量切割web日志shell服务器日志批量切割工具shell#!/bin/bash###################################

linux 批量切割web日志shell
服务器日志批量切割工具shell

#!/bin/bash############################################## at 2012-06-07#############################################logsPath=/web/logs/workPath=$1if [ -z ${workPath} ];then   echo "参数异常"   exitfiif [ ! -d logsPath ];then  mkdir -p ${logsPath}fi# supported pathsfor appPath in ${workPath}*; do    ${appPath}/bin/shutdown.sh    sleep 10    cat ${appPath}/logs/catalina.out > ${appPath}/logs/catalina.out.`date +%Y%m%d`    cat /dev/null > ${appPath}/logs/catalina.out    echo "daily rotating for "${appPath}" successfully at "`date +%Y%m%d` >> ${logsPath}/catalina_log.txt   ${appPath}/bin/startup.shdone

热点排行