随笔

od 查看非纯文本文件
cut -d ‘分割字符’ -f filds
split 切割文件 split -l 10 -laroot

tar -cvf -/home |tar -xvf - 管道的用 - 替代
tar -xvf -f tar包 -C /tmp -C解压特定目录的文件

例行性工作 at cron
软件安装:RPM、YUM、tar包源码安装

测试脚本
curl http://...😗***/nuccgateway/DS0002 -X POST -d @1.txt 1.txt为XML正文

http://130.1.12.236:8080/1.tar

清理日志
#!/bin/bash
. /home/esb/.bash_profile
#文件系统大于阀值,删除日志
kongjian=df -h 2>/dev/null|grep '/home'|awk -F " " '{print $4}'|cut -d % -f 1
b=90

if [ “ k o n g j i a n " − g t " kongjian" -gt " kongjian"gt"b” ]
then
echo “日志需要清理”

flag="0"
cd $FAPWORKDIR/log
if [ "x$dir" != "x" -a "x$dir" != "x." ]
then
	dirs=`find . -type d -print`
    	for file in $dirs
	do
        fname=`expr $file : '.*/\(.*\)'`
    if [ "x$fname" = "x$dir" ]
    then
        flag="1";
        break;
    fi
	done

	if [ "x$flag" = "x0" ]
	then
    echo "The directory:[$dir] is not available!"
    exit
fi

cd $dir

fi

if [ -d F A P W O R K D I R / l o g / FAPWORKDIR/log/ FAPWORKDIR/log/dir -o “x$dir” = “x” ]
then

find . -name “*” -type f -print -exec rm -f {} ;

log_name=`find . -name "*" -type f -print`

for file in $log_name
do
    fname=`expr $file : '.*/\(.*\)'`

#stdout, stderr will be truncate rather tran deleted!
if [ “x f n a m e " = " x s t d e r r " − o " x fname" = "xstderr" -o "x fname"="xstderr"o"xfname” = “xstdout” ]
then
echo “>$file”
> $file
else
echo $file
rm -f $file
fi
done
else
printf “The directory:[ $dir ] is not existent\n”
exit
fi
else
echo “日志不需要清理”
fi

自动刷新内存

Y=date "+%Y";
m=date "+%m";
d=date "+%d";
H=date "+%H";
M=date "+%M";
S=date "+%S";
sed -i ‘s/Version=.* / V e r s i o n = " s h e n m i d a i m a " / g ′ / h o m e / e s b / e t c / P r o j e c t . x m l ; e v a l s e d − i ′ s / s h e n m i d a i m a / " /Version="shenmidaima"/g' /home/esb/etc/Project.xml; eval sed -i 's/shenmidaima/" /Version="shenmidaima"/g/home/esb/etc/Project.xml;evalsedis/shenmidaima/"{Y}/KaTeX parse error: Undefined control sequence: \/ at position 4: {m}\̲/̲{d}\ H : {H}: H:{M}😒{S}"/g’ /home/esb/etc/Project.xml;
modeR;

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值