Skip to content
pvmehta.com

pvmehta.com

  • Home
  • About Me
  • Toggle search form
  • Reading config file from other folder inside class Python/PySpark
  • How to know Number of CPUs on Sun Box Linux/Unix
  • sbind.sql Find Bind variable from sql_id sqlid Oracle
  • Committing distributed transaction using commit force Oracle
  • Resolving RMAN Hung Jobs Oracle
  • Sort with ASCII order and Numeric Order Linux/Unix
  • get_vmstat.ksh Linux/Unix
  • New Latest Param.sql for finding all hidden parameters also Oracle
  • Good notes on Oracle Events Oracle
  • import-export with multiple files Oracle
  • Which environment is used by currently running process ( Very good) Linux/Unix
  • S3 Basic info AWS
  • How to set Processes Parameter Oracle
  • replace alphabets using sed Linux/Unix
  • usnsql.sql Displays information about UNDO segments with sql statements 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

  • Search and Replace vi editor command. Linux/Unix
  • Some OS level threshold for performance. Linux/Unix
  • Passing from Unix to PLSQL using bind variables Linux/Unix
  • move_arch_files.ksh Linux/Unix
  • More info about /proc folder and its relation with processes. Linux/Unix
  • secure crt settings 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 (393)
  • PHP/MYSQL/Wordpress (10)
  • POSTGRESQL (0)
  • 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

  • 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
  • V$INSTANCE of Oracle in MYSQL24-Jul-2025
  • Day to day MYSQL DBA operations (Compared with Oracle DBA)24-Jul-2025

Archives

  • 2025
  • 2024
  • 2023
  • 2010
  • 2009
  • 2008
  • 2007
  • 2006
  • 2005
  • Reading parameter file and printing Linux/Unix
  • Convert multiple rows to single column Oracle
  • Oracle 11g RAC on OEL 5 and Vmware 2 Oracle
  • How to choose Driver table in SQL statement Oracle
  • arch_configUOCIOTTO.ora Oracle
  • Pending Distributed Transations Oracle
  • Histogram Overview Oracle
  • Load testing on Oracle 19C RAC with HammerDB Oracle

Copyright © 2025 pvmehta.com.

Powered by PressBook News WordPress theme