Skip to content
pvmehta.com

pvmehta.com

  • Home
  • About Me
  • Toggle search form
  • Zip and unzip with tar Linux/Unix
  • Sending email with file attachment. Linux/Unix
  • Session_info.ksh Linux/Unix
  • set_env_dba Linux/Unix
  • To see how much time or progress of long transaction Oracle
  • Privilege to describe the table. Oracle
  • Directory wise folder wise space usage Linux/Unix
  • db_status.sql Oracle
  • grep multuple patterns Linux/Unix
  • Vivek’s egrep commands to trace problem. (on linux x86-64) Linux/Unix
  • SCRIPT TO LIST RECURSIVE DEPENDENCY BETWEEN OBJECTS UTLDTREE.sql Oracle
  • Query to Generate aggregate on every 30 mins. Oracle
  • myfile Oracle
  • Building Our Own Namespaces with “Create Context” Oracle
  • Removing first line Linux/Unix

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

  • to see when crontab is changed. Linux/Unix
  • How does one overcome the Unix 2 Gig file limit? Linux/Unix
  • Some OS level threshold for performance. Linux/Unix
  • age_alert.ksh aging out alert.log Linux/Unix
  • backspace in SQL Plus not working then..? Linux/Unix
  • move_arch_files.ksh Linux/Unix

Leave a Reply Cancel reply

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

Categories

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

Recent Posts

  • SQL Server Vs Oracle Architecture difference25-Jul-2025
  • SQL Server: How to see historical transactions25-Jul-2025
  • SQL Server: How to see current transactions or requests25-Jul-2025
  • T-SQL Vs PL/SQL Syntax25-Jul-2025
  • Check SQL Server edition25-Jul-2025
  • Checking SQL Server Version25-Jul-2025
  • Oracle vs MYSQL Architecture differences (For DBAs)24-Jul-2025
  • V$INSTANCE of Oracle in MYSQL24-Jul-2025
  • Day to day MYSQL DBA operations (Compared with Oracle DBA)24-Jul-2025
  • MYSQL and Oracle Comparison for Oracle DBA24-Jul-2025

Archives

  • 2025
  • 2024
  • 2023
  • 2010
  • 2009
  • 2008
  • 2007
  • 2006
  • 2005
  • To find all disk io ( EMC as well as local) Linux/Unix
  • cp_filesystem.sql Oracle
  • Good notes for shared pool Oracle
  • sid_wise_sql.sql Further explaination Oracle
  • Histogram Overview Oracle
  • Rman Notes -1 Oracle
  • Parallel DML Oracle
  • get_vmstat.ksh for Solaris Oracle

Copyright © 2025 pvmehta.com.

Powered by PressBook News WordPress theme