5.Monitor filesystem usage & delete expire file
[root@oracle6 source]# crontab -l
5,15,25,35,45,55 * * * * /home/mon/source/mon_filesystem_full >> /home/mon/log/mon_filesystem_full.log
[root@oracle6 source]#
[root@oracle6 source]#
[root@oracle6 source]# more mon_filesystem_full
#!/bin/bash
#monitor local filesystem is fully
LOG=/home/mon/data/filesystem_full.txt
FILE=/u01/oracle/product/11.2.0/dbhome_1/dbs
df -P > $LOG
cat $LOG | grep % | while
read LINE
do
PCT=`echo $LINE | awk '{print $5}'`
PCTD=`echo $PCT | tr "%" " "`
if [ $PCTD -gt 64 ]; then
#echo "$PCTD"
ls -tr $FILE/arch*dbf | head -10 | while
read NAME
do
#echo "$NAME"
rm $NAME
done
fi
done
find $FILE -name "arch*dbf" -mtime +30 -type f -exec rm -rf {} \;
5,15,25,35,45,55 * * * * /home/mon/source/mon_filesystem_full >> /home/mon/log/mon_filesystem_full.log
[root@oracle6 source]#
[root@oracle6 source]#
[root@oracle6 source]# more mon_filesystem_full
#!/bin/bash
#monitor local filesystem is fully
LOG=/home/mon/data/filesystem_full.txt
FILE=/u01/oracle/product/11.2.0/dbhome_1/dbs
df -P > $LOG
cat $LOG | grep % | while
read LINE
do
PCT=`echo $LINE | awk '{print $5}'`
PCTD=`echo $PCT | tr "%" " "`
if [ $PCTD -gt 64 ]; then
#echo "$PCTD"
ls -tr $FILE/arch*dbf | head -10 | while
read NAME
do
#echo "$NAME"
rm $NAME
done
fi
done
find $FILE -name "arch*dbf" -mtime +30 -type f -exec rm -rf {} \;
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/24237320/viewspace-2029581/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- [Shell] Monitor filesystem usage & delete expire filedelete
- 轉淘寶流雲dbms_file_transfer package usagePackage
- dnsjava usageDNSJava
- [Shell] monitor filesystem
- Oracle歸檔日誌使用情況: v$recovery_file_dest and v$recovery_area_usage.Oracle
- Unix Sed Tutorial: Delete File Lines Using Address and Patternsdelete
- PHP Filesystem 簡介PHP
- costume GIT usage for meGit
- solaris 10 disksuite usageUI
- table type usage sample:
- SQLNET.EXPIRE_TIME測試SQL
- [Oracle Script] Temporary Sort UsageOracle
- [Oracle Script] Rollback Segment UsageOracle
- BlockRecover Restrictions and Usage NotesBloCREST
- Clear Case usage tips
- Oracle runInstaller 's UsageOracle
- Oracle NUMA usage recommendationOracle
- MySQL, Incorrect usage of UNION and ORDER BYMySql
- Mount: you must specify the filesystem type
- 3.linux monitor filesystemLinux
- delete input 與 delete all inputdelete
- delete OBSOLETE 與 delete expirieddelete
- deletedelete
- [Oracle Script] check tablespace usage infoOracle
- [Oracle Script] check temp tablespace usageOracle
- [Oracle Script] Undo Usage Per statusOracle
- [Oracle Script] Undo Usage Per sessionOracleSession
- Oracle 11g tablespace usageOracle
- [Shell] Linux monitor tablespace usageLinux
- V$sort_usage, where is the definition?
- 無法寫入檔案 Filesystem
- busybox filesystem add ldd functionFunction
- delete 和 delete [] 的真正區別delete
- delete與delete[]需要注意的地方delete
- 4.Linux monitor tablespace usageLinux
- Oracle NUMA Usage Recommendation [ID 759565.1]Oracle
- 如何設定redis中hash的field的expire ?Redis
- ORA-28002: the password will expire解決方法