磁盘清理脚本
2017-03-30 23:14
381 查看
历史原因,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
相关文章推荐
- Hadoop集群上检查磁盘使用量和清理相关日志文件脚本
- 磁盘清理脚本
- 几个shell自动化脚本(定期清理、磁盘空间、搜寻关键字)
- 实用shell脚本之磁盘清理
- bat脚本之垃圾清理
- ClearDisk for Mac(磁盘清理系统优化工具) V2.6破解版
- Win8打开与使用磁盘清理功能全程图解
- 磁盘空间不足怎么办,linux磁盘清理方法
- 软件包清理的shell脚本
- oracle 11g RAC 清理磁盘空间,crfclust.bdb过大的处理
- WordPress提速优化篇:清理HEAD头部多余脚本
- Windows系统清理QQ聊天记录、反监控QQ聊天的BAT脚本分享
- 服务自动拉起,定时日志清理,数据统计的shell脚本
- Linux shell脚本判断输入目录是否存在,并输出目录所在磁盘使用量
- Oracle 12c数据库定时备份和清理脚本
- ubuntu系统如何清理磁盘
- Linux服务器 CentOS 6系列最小化安装优化脚本详解02————修改history记录、定时校正服务器时间、停止IPv6网络服务、调整最大文件打开数、关闭写磁盘I/O功能、配置SSH服务
- 对网上流传的SQL日志清理脚本的小小改进
- win10系统电脑C盘磁盘碎片怎么清理?
- 转载一篇磁盘检测报警脚本