Linux下收集日誌的簡單指令碼

2021-06-09 02:16:47 字數 747 閱讀 8671

[root@localhost /]# cat test.sh

#!/bin/sh

#shihaiyan

#set -x

#varible

out_path=

##########usagse#########

usagse()

if [[ $1 == "" ]] || [[ $1 == "?" ]]

then

usagse

fiout_path=/tmp/yan/

if [ -d $ ]

then

echo "$ is already"

read -p "do you want to delete it ?(y/n):" var

if [[ $var == "y" ]] || [[ $var == "y" ]]

then

rm -rf $/*

echo "delete old file  after,new file also created"

else

echo "file exist ! please delete it first !"

exit 1

fielse

mkdir $

fiifconfig > $/ifconfig.txt

cp -p /shy/tool.txt  $/

/test.sh > $/test.txt

[root@localhost /]#

計算linux系統資源的簡單指令碼

簡單的統計伺服器的每個服務的記憶體使用 cpu 的使用率 記憶體剩餘大小 指令碼具體的內容 bin bash system resources statistic script.cpu use ps aux awk awk beginend echo echo cpu use cpu use 上面是...

Linux下SUN的JRE問題日誌收集

linux 下 sun的 jre問題日誌收集 在 linux 下使用sun 提供的jre 當發生 core dump 時,如果確認是由 jre造成的,sun通常需要你提供日誌以供分析。通常是通過執行 指令碼來收集。該指令碼可在 sun。工具需要 ksh的支援,因此如果 linux 上沒有按照 ksh...

linux下配置rsyslog日誌收集伺服器案例

環境配置 centos6系統 client1 192.168.1.33 centos7系統 client2 192.168.1.44 centos7系統 master 192.168.1.55 配置服務端master端 第一 啟用udp tcp進行傳輸 vim etc rsyslog.conf pr...