Skip to content
pvmehta.com

pvmehta.com

  • Home
  • About Me
  • Toggle search form
  • Settting up get_vmstat.sh for colletinf CPU Usage. Oracle
  • Resolving RMAN Hung Jobs Oracle
  • Goldengate Tutorial Oracle
  • good note for shared pool tunnig Oracle
  • online_bkup.sql Oracle
  • .profile Linux/Unix
  • SCRIPT TO LIST RECURSIVE DEPENDENCY BETWEEN OBJECTS UTLDTREE.sql Oracle
  • newupload.html PHP/MYSQL/Wordpress
  • Multiple listeners Oracle
  • Search and Replace vi editor command. Linux/Unix
  • New OFA for 11g Oracle
  • How to remove blank lines using vi editor command Linux/Unix
  • Wait Based Tuning Step by step with SQL statement Oracle
  • Check Oracle installed products using one command Oracle
  • Oracle 11g Training on 29JAN1010 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: rm_backup_arch_file.ksh
Next Post: .profile

Related Posts

  • restarting network in linux Linux/Unix
  • CPU speed on Linux Linux/Unix
  • cif crons Linux/Unix
  • send email from unix mailx with attachment. Linux/Unix
  • Logic to chech # of parameters command line parameters Linux/Unix
  • tar and untar a dolder with all its subfolder. 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)
  • Django (0)
  • GIT (1)
  • Linux/Unix (149)
  • MYSQL (5)
  • Oracle (393)
  • PHP/MYSQL/Wordpress (10)
  • POSTGRESQL (1)
  • Power-BI (0)
  • Python/PySpark (7)
  • RAC (17)
  • rman-dataguard (26)
  • shell (149)
  • SQL scripts (342)
  • SQL Server (6)
  • Uncategorized (0)
  • Videos (0)

Recent Posts

  • Complete Git Tutorial for Beginners25-Dec-2025
  • Postgres DB user and OS user.25-Dec-2025
  • Trace a SQL session from another session using ORADEBUG30-Sep-2025
  • 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

Archives

  • 2025
  • 2024
  • 2023
  • 2010
  • 2009
  • 2008
  • 2007
  • 2006
  • 2005
  • how to find VIP from ifconfig Linux/Unix
  • GSQ.sql Oracle
  • move_arch_files.ksh Linux/Unix
  • How to find Unix server conguraiton including Server Model number and underlying disk sub-system ( On Solaris) Linux/Unix
  • Sending email with file attachment. Linux/Unix
  • USER_TABLES.Freelists Oracle
  • exp syntax in oracle 10g Oracle
  • Complete Git Tutorial for Beginners GIT

Copyright © 2026 pvmehta.com.

Powered by PressBook News WordPress theme