標籤:磁碟 清理
曆史原因,DB2採用歸檔日誌,每天增加量50G左右,磁碟吃不消,而現在來說,這些歸檔是用不到的,古寫個指令碼清理磁碟空間當大於85%的時候
#!/usr/bin/ksh#############################################################Author:fuwenchao##version:1##time:2014-5-28##purpose:clear the db2 log when there is no more space##########################################################. ~/.profilermdir=/crm/crmuser/db2backup/db2inst1/CRMDB/NODE0000/C0000000rmlog=/crm/crmuser/shellscript/rm85.loglarge=`df -g |awk ‘{print $4}‘|tail -1|sed s#%##`if [ $large -gt 85 ]thencd $rmdir && rm -f *LOGecho "===============================================clear==================================================">>$rmlogecho "this is no more space and I have been cleared the db2 log,and clear time is:"`date +%Y-%m-%d‘ ‘%T`>>$rmlogelseecho "=========================================not clear======================================">>$rmlogecho "this is left lots of spaces;time is:"`date +%Y-%m-%d‘ ‘%T`>>$rmlogfi
本文出自 “從營運到ETL” 部落格,請務必保留此出處http://fuwenchao.blog.51cto.com/6008712/1531149