磁碟清理指令碼

來源:互聯網
上載者:User

標籤:磁碟   清理   

曆史原因,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

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.