Skip to content
pvmehta.com

pvmehta.com

  • Home
  • About Me
  • Toggle search form
  • TNSNAMES entries details Oracle
  • before_trunc.sql Before Truncate table needs to execute following: Oracle
  • Renaming Oracle Instance Name Oracle
  • Oracle 11g Environment Setup Oracle
  • TABLE SIZING WITH DB_BLOCK ARCHITECTURE Reference : Metalink note : 10640.1 Oracle
  • Important Script Method for tuning Oracle
  • proc.sql Oracle
  • Getting started with notebook Python/PySpark
  • executing Function from SQLPLUS prompt Oracle
  • Temporary Tablespace Information and restriction. Oracle
  • Jai Shree Ram PHP/MYSQL/Wordpress
  • How to calculate PROCESSES parameter Oracle
  • New Latest Param.sql for finding all hidden parameters also Oracle
  • How to choose Driver table in SQL statement Oracle
  • db_status.sql 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

  • How to sort list of files on basis of their sizes. Linux/Unix
  • Implementation of key based authentications Linux/Unix
  • move_arch_files.ksh Linux/Unix
  • rm_backup_arch_file.ksh Linux/Unix
  • Removing Ctrl-M from end of line using vi Linux/Unix
  • cold backup scripts to copy locally 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 (394)
  • PHP/MYSQL/Wordpress (10)
  • POSTGRESQL (1)
  • Power-BI (0)
  • Python/PySpark (7)
  • RAC (17)
  • rman-dataguard (26)
  • shell (149)
  • SQL scripts (343)
  • SQL Server (6)
  • Uncategorized (0)
  • Videos (0)

Recent Posts

  • tracksqltime.sql05-Mar-2026
  • 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

Archives

  • 2026
  • 2025
  • 2024
  • 2023
  • 2010
  • 2009
  • 2008
  • 2007
  • 2006
  • 2005
  • find checksum of a file. Linux/Unix
  • OEM-troubleshooting on 20-MAY-08 Oracle
  • sqlnet.ora paramters Oracle
  • pvm_pre_change.sql Oracle
  • How to see which patches are applied. Oracle
  • 339939.1 Running Cluster Verification Utility to Diagnose Install Problems Oracle
  • Find execution plan from dba_hist_sql_plan for a specific SQL_ID and PLAN_HASH_VALUE fplan.sql Oracle
  • SQLPLUS COPY command Precautions. Oracle

Copyright © 2026 pvmehta.com.

Powered by PressBook News WordPress theme