[[Email protected] ~] # Cat pull_log.sh
#! /Bin/bash
# Date = 2014-09-16
# Is to pull the app log
Echo-ne "\ 033 [31 m \ 033 [05 m the time format of the risk and BP is % Y-% m-% d % H: % m: % S. the POS is % H: % m: % s \ 033 [0 m"
Read-P "Please input your app": app
Read-P "Please input your time interval": time1
Read-P "Please input your time interval again": time2
Case $ app in
Pos)
CD/usr/local/JBoss/Server/JBoss-pos/log
Sed-n "/^ $ {time1} */,/^ $ {time2} */P" POS. Log>/root/pos21.log
Gzip-9/root/pos21.log
;;
RIS)
CD/usr/local/JBoss/Server/JBoss-Ris/log
Sed-n "/^ $ {time1} */,/^ $ {time2} */P" server. Log>/root/risserver21.log
Gzip-9/root/risserver21.log
;;
BPL)
CD/usr/local/JBoss/Server/JBoss-BPl/log
Sed-n "/^ $ {time1} */,/^ $ {time2} */P" server. Log>/root/bplserver21.log
Gzip-9/root/bplserver21.log
;;
*)
Echo "Please input right app"
;;
Esac
This article is from the "route sweat exchange successful" blog, please be sure to keep this source http://ghnhl.blog.51cto.com/1630025/1553278
Use scripts to pull project logs