刪除EBS AP Tier上的記錄檔、暫存檔

EBS在運行期間,會增加許多的記錄檔、暫存檔等,之前一直沒注意,所以產生超過50G的無用檔案。

為了怕之後忘記,所以記錄一下。
主要是清除下列路徑的檔案:
$COMMON_TOP/admin/log/SID_HOST/*
$COMMON_TOP/admin/out/SID_HOST/*
$APPL_TOP/admin/SID/log
$APPL_TOP/admin/SID/out
/usr/tmp
$IAS_ORACLE_HOME/Apache/Apache/logs
$IAS_ORACLE_HOME/Apache/Jserv/logs
$OA_HTML/cabo/images/cache/en (依據ERP使用的語言)

不過之前為了刪除.RTF的暫存檔,但是因為登入到root帳號,所以$COMMON_TOP是空值,導致刪除所有目錄下的.RTF檔。

所以現在我都習慣改用絕對路徑加指定帳號、副檔名等,避免出現誤刪的情形。

Script大致如下:
#!/bin/sh
find /erpap/prodlog/log/PROD_test -user testmgr -mtime +7 -name "*.req" -exec rm {} \;
find /erpap/prodlog/log/PROD_test -user testmgr -mtime +7 -name "*.mgr" -exec rm {} \;
find /erpap/prodlog/out/PROD_test -user testmgr -mtime +7 -name "o*.out" -exec rm {} \;
find /erpap/prodcomn/admin/log/PROD_test -user testmgr -mtime +7 -name "em_*.rti" -exec rm {} \;
find /erpap/prodcomn/admin/log/PROD_test -user testmgr -mtime +7 -name "f60webmx_dump_*" -exec rm {} \;
find /erpap/prodcomn/admin/out/PROD_test -user testmgr -mtime +7 -name "o*.out" -exec rm {} \;
find /erpap/prodcomn/admin/out/PROD_test -user testmgr -mtime +7 -name "F*.HTML" -exec rm {} \;
find /erpap/prodcomn/admin/out/PROD_test -user testmgr -mtime +7 -name "F*.RTF" -exec rm {} \;
find /erpap/prodcomn/admin/out/PROD_test -user testmgr -mtime +7 -name "M*.ctl" -exec rm {} \;
find /erpap/prodcomn/admin/out/PROD_test -user testmgr -mtime +7 -name "M*.dat" -exec rm {} \;
find /erpap/prodora/iAS/Apache/Apache/logs -user testmgr -mtime +7 -name "access_log*" -exec rm {} \;
find /erpap/prodora/iAS/Apache/Apache/logs -user testmgr -mtime +7 -name "error_log*" -exec rm {} \;
find /erpap/prodcomn/temp -user testmgr -mtime +7 -name "OF*.t" -exec rm {} \;
find /erpap/prodcomn/temp -user testmgr -mtime +7 -name "OF*.t.zht" -exec rm {} \;
find /erpap/prodlog/out/PROD_test -user testmgr -mtime +7 -name "*.ctl" -exec rm {} \;
find /erpap/prodlog/out/PROD_test -user testmgr -mtime +7 -name "*.dat" -exec rm {} \;
find /erpap/prodlog/out/PROD_test -user testmgr -mtime +7 -name "*.RTF" -exec rm {} \;
find /erpap/prodlog/out/PROD_test -user testmgr -mtime +7 -name "*.PDF" -exec rm {} \;