Sponsored Content
Top Forums Shell Programming and Scripting Purging 2000+ directories efficiently Post 302824031 by Apoorvbarwa on Thursday 20th of June 2013 06:37:55 AM
Old 06-20-2013
Purging 2000+ directories efficiently

Hi

I have a requirement wherein i need to purge some directories.

I have more than 2000 directories where i need to keep data for 10 days and delete the rest. What i am looking for is an efficient way to achieve this.

There are four mount points from where i need to delete the files.

Below is an example of the structure of the mount points.

Code:
/XXXX/XXX/XXXX/XXXX/XXXX/<AAAAA>/<aaaa>/duplicate
                          exception
                          archive

/XXXX/XXX/XXXX/XXXX/XXXX/custom/xxx/<aaa>/archive

/XXXX/XXX/XXXX/XXXX/XXXX/<format>/archive

/XXXX/XXX/XXXX/XXXX/

I am aware of the conditions that should be in place for the deletion to take place but since the number of directories is too much it would be helpful if anyone can suggest an efficient way of doing this.

All values within <> eg. <AAAAA> will be fetched using sql scripts.

The shell i am using is ksh.

Last edited by jim mcnamara; 06-20-2013 at 08:28 AM..
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Purging script

Hi, Need to change the following command to also purge the child directories after /data/tmp within one command (recursively check for X number of days old files and purge accordingly)? e.g. /data/tmp/a, /data/tmp/a/b, /data/tmp/log. find /data/tmp -type f -mtime +7 -exec rm -f {} \; ... (2 Replies)
Discussion started by: egls
2 Replies

2. Shell Programming and Scripting

Using xapply efficiently?

Hi all, Were currently using xapply to run multiple ssh instances that then calls a script that returns the PID of a webserver process. Currently we have like 30 xapply statements in a script call checkit which checks various webserver processes on various unix/linux boxes. My question... (0 Replies)
Discussion started by: bdsffl
0 Replies

3. Shell Programming and Scripting

Purging a Set of Files

Hi Frineds, I want to delete a set of files which are older than 7 days from teh current date.I am totally enw to shell scripting, can anyone help me with a sample code to list out the files which are older and then remove them from the directory. Please help THanks Viswa (5 Replies)
Discussion started by: svishh123
5 Replies

4. Shell Programming and Scripting

Error While Purging Files

find /filearchive/ -type f -mtime +7 -exec rm weblogs*.log {} \; This worked only if this comand is executed int he unix comand prompt, but when i put this in the shell script it is not recognizing the file.It says weblogs: No such file or directory Am i doing anything wrong here ? (4 Replies)
Discussion started by: svishh123
4 Replies

5. Shell Programming and Scripting

Shell script for purging the 3 days old files

Hi all, I try to write shell script to the below requirement. I have Hard coded the oratab location and take the list of databases from oratab and find out archive log locations for each database, and list more than 3 days old files for each location and purge those. ... (2 Replies)
Discussion started by: mak_boop
2 Replies

6. Shell Programming and Scripting

purging of Files

Hello All, I want to delete the files based on the days. like, Files available under directory /abc want to delete if they are older than 15 days. Files available under directory /pqr want to delete if they are 7 days old and some files under directory /xyz should get deleted if they are... (5 Replies)
Discussion started by: ssachins
5 Replies

7. Shell Programming and Scripting

Fine Tune - Huge files/directory - Purging

Hi Expert's, I need your assitance in tunning one script. I have a mount point where almost 4848008 files and 864739 directories are present. The script search for specific pattern files and specfic period then delete them to free up space. The script is designed to run daily and its taking around... (19 Replies)
Discussion started by: senthil.ak
19 Replies

8. Shell Programming and Scripting

Disc space issues and purging of files

Hi All, I am looking forward to create a unix shell script to purge the files. The requirement is: 1) Do df -k and check the current space occupied for the /a1 folder. 2) If the space consumed is greater than 90 %, delete all the DEF* files from a subfolder /a1/archive. Example: df... (4 Replies)
Discussion started by: shilpa_acc
4 Replies

9. UNIX for Dummies Questions & Answers

Purging logic

Hi guys i am having following files in a directory a_07:15:13.txt a_07:16:13.txt a_07:17:13.txt a_07:18:13.txt a_07:19:13.txt a_date file will be created on a day to day basics so that it may pileup on a long go.So i need to create a logic so that the files will be gunzipped to a backup... (1 Reply)
Discussion started by: mohanalakshmi
1 Replies
DateTime::Locale::ti_ER(3)				User Contributed Perl Documentation				DateTime::Locale::ti_ER(3)

NAME
DateTime::Locale::ti_ER SYNOPSIS
use DateTime; my $dt = DateTime->now( locale => 'ti_ER' ); print $dt->month_name(); DESCRIPTION
This is the DateTime locale package for Tigrinya Eritrea. DATA
This locale inherits from the DateTime::Locale::ti locale. It contains the following data. Days Wide (format) XXX XXX XXX XXX XXX XXX XXXX Abbreviated (format) XXX XXX XXX XXX XXX XXX XXX Narrow (format) X X X X X X X Wide (stand-alone) XXX XXX XXX XXX XXX XXX XXXX Abbreviated (stand-alone) XXX XXX XXX XXX XXX XXX XXX Narrow (stand-alone) X X X X X X X Months Wide (format) XX XXXX XXXX XXXX XXXX XX XXX XXX XXXXX XXXX XXX XXXX Abbreviated (format) XX XXX XXX XXX XXX XX XXX XXX XXX XXX XXX XXX Narrow (format) XX XXX XXX XXX XXX XX XXX XXX XXX XXX XXX XXX Wide (stand-alone) XX XXXX XXXX XXXX XXXX XX XXX XXX XXXXX XXXX XXX XXXX Abbreviated (stand-alone) XX XXX XXX XXX XXX XX XXX XXX XXX XXX XXX XXX Narrow (stand-alone) X X X X X X X X X X X X Quarters Wide (format) Q1 Q2 Q3 Q4 Abbreviated (format) Q1 Q2 Q3 Q4 Narrow (format) 1 2 3 4 Wide (stand-alone) Q1 Q2 Q3 Q4 Abbreviated (stand-alone) Q1 Q2 Q3 Q4 Narrow (stand-alone) 1 2 3 4 Eras Wide BCE CE Abbreviated X/X X/X Narrow X/X X/X Date Formats Full 2008-02-05T18:30:30 = XXXX 05 XXXX XXXX 2008 X/X 1995-12-22T09:05:02 = XXXX 22 XXXX XXXX 1995 X/X -0010-09-15T04:44:23 = XXXX 15 XXXXX XXXX -10 X/X Long 2008-02-05T18:30:30 = 05 XXXX 2008 1995-12-22T09:05:02 = 22 XXXX 1995 -0010-09-15T04:44:23 = 15 XXXXX -10 Medium 2008-02-05T18:30:30 = 05-XXX-2008 1995-12-22T09:05:02 = 22-XXX-1995 -0010-09-15T04:44:23 = 15-XXX--10 Short 2008-02-05T18:30:30 = 05/02/08 1995-12-22T09:05:02 = 22/12/95 -0010-09-15T04:44:23 = 15/09/-10 Default 2008-02-05T18:30:30 = 05-XXX-2008 1995-12-22T09:05:02 = 22-XXX-1995 -0010-09-15T04:44:23 = 15-XXX--10 Time Formats Full 2008-02-05T18:30:30 = 6:30:30 XXX XXX UTC 1995-12-22T09:05:02 = 9:05:02 XXX XXX UTC -0010-09-15T04:44:23 = 4:44:23 XXX XXX UTC Long 2008-02-05T18:30:30 = 6:30:30 XXX XXX UTC 1995-12-22T09:05:02 = 9:05:02 XXX XXX UTC -0010-09-15T04:44:23 = 4:44:23 XXX XXX UTC Medium 2008-02-05T18:30:30 = 6:30:30 XXX XXX 1995-12-22T09:05:02 = 9:05:02 XXX XXX -0010-09-15T04:44:23 = 4:44:23 XXX XXX Short 2008-02-05T18:30:30 = 6:30 XXX XXX 1995-12-22T09:05:02 = 9:05 XXX XXX -0010-09-15T04:44:23 = 4:44 XXX XXX Default 2008-02-05T18:30:30 = 6:30:30 XXX XXX 1995-12-22T09:05:02 = 9:05:02 XXX XXX -0010-09-15T04:44:23 = 4:44:23 XXX XXX Datetime Formats Full 2008-02-05T18:30:30 = XXXX 05 XXXX XXXX 2008 X/X 6:30:30 XXX XXX UTC 1995-12-22T09:05:02 = XXXX 22 XXXX XXXX 1995 X/X 9:05:02 XXX XXX UTC -0010-09-15T04:44:23 = XXXX 15 XXXXX XXXX -10 X/X 4:44:23 XXX XXX UTC Long 2008-02-05T18:30:30 = 05 XXXX 2008 6:30:30 XXX XXX UTC 1995-12-22T09:05:02 = 22 XXXX 1995 9:05:02 XXX XXX UTC -0010-09-15T04:44:23 = 15 XXXXX -10 4:44:23 XXX XXX UTC Medium 2008-02-05T18:30:30 = 05-XXX-2008 6:30:30 XXX XXX 1995-12-22T09:05:02 = 22-XXX-1995 9:05:02 XXX XXX -0010-09-15T04:44:23 = 15-XXX--10 4:44:23 XXX XXX Short 2008-02-05T18:30:30 = 05/02/08 6:30 XXX XXX 1995-12-22T09:05:02 = 22/12/95 9:05 XXX XXX -0010-09-15T04:44:23 = 15/09/-10 4:44 XXX XXX Default 2008-02-05T18:30:30 = 05-XXX-2008 6:30:30 XXX XXX 1995-12-22T09:05:02 = 22-XXX-1995 9:05:02 XXX XXX -0010-09-15T04:44:23 = 15-XXX--10 4:44:23 XXX XXX Available Formats d (d) 2008-02-05T18:30:30 = 5 1995-12-22T09:05:02 = 22 -0010-09-15T04:44:23 = 15 EEEd (d EEE) 2008-02-05T18:30:30 = 5 XXX 1995-12-22T09:05:02 = 22 XXX -0010-09-15T04:44:23 = 15 XXX Hm (H:mm) 2008-02-05T18:30:30 = 18:30 1995-12-22T09:05:02 = 9:05 -0010-09-15T04:44:23 = 4:44 hm (h:mm a) 2008-02-05T18:30:30 = 6:30 XXX XXX 1995-12-22T09:05:02 = 9:05 XXX XXX -0010-09-15T04:44:23 = 4:44 XXX XXX Hms (H:mm:ss) 2008-02-05T18:30:30 = 18:30:30 1995-12-22T09:05:02 = 9:05:02 -0010-09-15T04:44:23 = 4:44:23 hms (h:mm:ss a) 2008-02-05T18:30:30 = 6:30:30 XXX XXX 1995-12-22T09:05:02 = 9:05:02 XXX XXX -0010-09-15T04:44:23 = 4:44:23 XXX XXX M (L) 2008-02-05T18:30:30 = 2 1995-12-22T09:05:02 = 12 -0010-09-15T04:44:23 = 9 Md (M-d) 2008-02-05T18:30:30 = 2-5 1995-12-22T09:05:02 = 12-22 -0010-09-15T04:44:23 = 9-15 MEd (E, M-d) 2008-02-05T18:30:30 = XXX, 2-5 1995-12-22T09:05:02 = XXX, 12-22 -0010-09-15T04:44:23 = XXX, 9-15 MMdd (dd/MM) 2008-02-05T18:30:30 = 05/02 1995-12-22T09:05:02 = 22/12 -0010-09-15T04:44:23 = 15/09 MMM (LLL) 2008-02-05T18:30:30 = XXX 1995-12-22T09:05:02 = XXX -0010-09-15T04:44:23 = XXX MMMd (MMM d) 2008-02-05T18:30:30 = XXX 5 1995-12-22T09:05:02 = XXX 22 -0010-09-15T04:44:23 = XXX 15 MMMEd (E MMM d) 2008-02-05T18:30:30 = XXX XXX 5 1995-12-22T09:05:02 = XXX XXX 22 -0010-09-15T04:44:23 = XXX XXX 15 MMMMd (MMMM d) 2008-02-05T18:30:30 = XXXX 5 1995-12-22T09:05:02 = XXXX 22 -0010-09-15T04:44:23 = XXXXX 15 MMMMdd (dd MMMM) 2008-02-05T18:30:30 = 05 XXXX 1995-12-22T09:05:02 = 22 XXXX -0010-09-15T04:44:23 = 15 XXXXX MMMMEd (E MMMM d) 2008-02-05T18:30:30 = XXX XXXX 5 1995-12-22T09:05:02 = XXX XXXX 22 -0010-09-15T04:44:23 = XXX XXXXX 15 ms (mm:ss) 2008-02-05T18:30:30 = 30:30 1995-12-22T09:05:02 = 05:02 -0010-09-15T04:44:23 = 44:23 y (y) 2008-02-05T18:30:30 = 2008 1995-12-22T09:05:02 = 1995 -0010-09-15T04:44:23 = -10 yM (y-M) 2008-02-05T18:30:30 = 2008-2 1995-12-22T09:05:02 = 1995-12 -0010-09-15T04:44:23 = -10-9 yMEd (EEE, y-M-d) 2008-02-05T18:30:30 = XXX, 2008-2-5 1995-12-22T09:05:02 = XXX, 1995-12-22 -0010-09-15T04:44:23 = XXX, -10-9-15 yMMM (y MMM) 2008-02-05T18:30:30 = 2008 XXX 1995-12-22T09:05:02 = 1995 XXX -0010-09-15T04:44:23 = -10 XXX yMMMEd (EEE, y MMM d) 2008-02-05T18:30:30 = XXX, 2008 XXX 5 1995-12-22T09:05:02 = XXX, 1995 XXX 22 -0010-09-15T04:44:23 = XXX, -10 XXX 15 yMMMM (y MMMM) 2008-02-05T18:30:30 = 2008 XXXX 1995-12-22T09:05:02 = 1995 XXXX -0010-09-15T04:44:23 = -10 XXXXX yQ (y Q) 2008-02-05T18:30:30 = 2008 1 1995-12-22T09:05:02 = 1995 4 -0010-09-15T04:44:23 = -10 3 yQQQ (y QQQ) 2008-02-05T18:30:30 = 2008 Q1 1995-12-22T09:05:02 = 1995 Q4 -0010-09-15T04:44:23 = -10 Q3 yyMM (MM/yy) 2008-02-05T18:30:30 = 02/08 1995-12-22T09:05:02 = 12/95 -0010-09-15T04:44:23 = 09/-10 yyQ (Q yy) 2008-02-05T18:30:30 = 1 08 1995-12-22T09:05:02 = 4 95 -0010-09-15T04:44:23 = 3 -10 yyyyMMMM (MMMM y) 2008-02-05T18:30:30 = XXXX 2008 1995-12-22T09:05:02 = XXXX 1995 -0010-09-15T04:44:23 = XXXXX -10 Miscellaneous Prefers 24 hour time? No Local first day of the week XXX SUPPORT
See DateTime::Locale. AUTHOR
Dave Rolsky <autarch@urth.org> COPYRIGHT
Copyright (c) 2008 David Rolsky. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. This module was generated from data provided by the CLDR project, see the LICENSE.cldr in this distribution for details on the CLDR data's license. perl v5.16.3 2014-06-10 DateTime::Locale::ti_ER(3)
All times are GMT -4. The time now is 09:43 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy