Skip to content
pvmehta.com

pvmehta.com

  • Home
  • About Me
  • Toggle search form
  • SQL_PLAN.sql for checking real execution plan Oracle
  • pvm_pre_change.sql Oracle
  • Rman Notes -1 Oracle
  • get_vmstat.ksh Linux/Unix
  • Jai Shree Ram PHP/MYSQL/Wordpress
  • handling filenname with space Linux/Unix
  • This is im telling Kishore Oracle
  • dbms_job.submit example Oracle
  • Establishing trusted relationship between dbmonitor( central monitoring) and monitoring targets. Linux/Unix
  • To see mem usage and CPU usage system wide. Linux/Unix
  • tuning commmand for cpu, ip and memory stats Linux/Unix
  • chk_space_SID.ksh Linux/Unix
  • How to connect to Oracle Database with Wallet with Python. Oracle
  • Find_planinfo.sql Oracle
  • Disbaling DBA_SCHEDULER_JOBS Oracle

rm_backup_arch_file.ksh

Posted on 02-Aug-2005 By Admin No Comments on rm_backup_arch_file.ksh

a=`ps -ef|grep $SCRIPT_NAME|grep -v grep|wc -l`

if [ $a -gt 2 ]

then

echo “Exiting because of more than 1 Moving archive log script is running ” >>$LOGFILE

exit

fi

cd $DESTFOLDER

b=0

buffersize=85

currentdskspce=`df -k $DESTFOLDER|tail -1 |awk {‘print $5’}| sed ‘s/%//g’`

echo “This $DESTFOLDER files removal script was executed on `date`” >>$LOGFILE

while [ $currentdskspce -ge $buffersize ]

do

b=1

files2remove=`ls -latr * |head -1|awk {‘print $9’}`

echo “the files to be removed are $files2remove” >>$LOGFILE

rm $files2remove

currentdskspce=`df -k $DESTFOLDER|tail -1 |awk {‘print $5’}| sed ‘s/%//g’`

echo “the current space utilization is $currentdskspce” >>$LOGFILE

done

if [ $b -gt 0 ]

then

mailx -s ” File Removed Alert from $NODENAME, $ORACLE_SID Database” $NOTIFY_LIST< Archive log files were removed from $DESTFOLDER

Currently $DESTFOLDER is at $currentdskspce %

EOF

fi

Linux/Unix, shell

Post navigation

Previous Post: purge_trc.sh
Next Post: .profile

Related Posts

  • xargs use Linux/Unix
  • remove archfiles only when it is applied to DR rm_archfiles.sh Linux/Unix
  • default permission on ~/.ssh/authorized_keys2 or authorized_keys Linux/Unix
  • CPU Core related projections AWS
  • age_alert.ksh aging out alert.log Linux/Unix
  • find_du.ksh to find # of files, their sizes in current folder and its subdolder Linux/Unix

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Categories

  • AWS (2)
  • Azure (1)
  • Linux/Unix (149)
  • Oracle (392)
  • PHP/MYSQL/Wordpress (10)
  • Power-BI (0)
  • Python/PySpark (7)
  • RAC (17)
  • rman-dataguard (26)
  • shell (149)
  • SQL scripts (341)
  • Uncategorized (0)
  • Videos (0)

Recent Posts

  • load SPM baseline from cursor cache05-Jun-2025
  • Drop all SPM baselines for SQL handle05-Jun-2025
  • Load SPM baseline from AWR05-Jun-2025
  • Drop specific SQL plan baseline – spm05-Jun-2025
  • findinfo.sql (SQL for getting CPU and Active session info)27-May-2025
  • SQL Tracker by SID sqltrackerbysid.sql22-Apr-2025
  • How to connect to Oracle Database with Wallet with Python.21-Mar-2025
  • JSON/XML Types in Oracle18-Mar-2025
  • CPU Core related projections12-Mar-2025
  • Exadata Basics10-Dec-2024

Archives

  • 2025
  • 2024
  • 2023
  • 2010
  • 2009
  • 2008
  • 2007
  • 2006
  • 2005
  • executing Function from SQLPLUS prompt Oracle
  • How to sort list of files on basis of their sizes. Linux/Unix
  • switchover for primary database Oracle
  • good note for shared pool tunnig Oracle
  • Another export with Query Oracle
  • tblwopk.sql tablewopk.sql Oracle
  • Explain Plan Doesn’T Change For Sql After New Statistics Generated Oracle
  • findobj.sql Oracle

Copyright © 2025 pvmehta.com.

Powered by PressBook News WordPress theme