find help with directory purge.

 
Thread Tools Search this Thread
Operating Systems Linux Red Hat find help with directory purge.
# 1  
Old 06-04-2010
find help with directory purge.

Hi, I have a purge directory called /b02/purge which has backed up directories like this

drwxrwxr-x 17 root root 4096 Jan 5 15:33 purge1
drwxrwxr-x 17 root root 4096 Jan 5 16:21 purge.new1
drwxrwxr-x 15 root root 4096 Jan 5 16:21 purge.new2
drwxrwxr-x 17 root root 4096 Jan 12 16:16 purge.new3
drwxrwxr-x 18 root root 4096 Jan 15 14:44 purge.new4
drwxrwxr-x 18 root root 4096 Jan 19 14:59 purge.new5
drwxrwxr-x 17 root root 4096 Jan 22 11:27 purge.new6
drwxrwxr-x 17 root root 4096 Jan 26 19:30 purge.new7
drwxrwxr-x 18 root root 4096 Feb 1 11:17 purge.new8
drwxr-xr-x 15 root root 4096 Feb 2 18:53 purge.new9
drwxrwxr-x 15 root root 4096 Feb 4 15:03 purge.new10
drwxrwxr-x 15 root root 4096 May 9 15:02 purge.new11
drwxrwxr-x 15 root root 4096 Jun 2 14:50 purge

how can i purge directories which are created older than 60 days only by looking at purge directory's time stamp.

any help is appreciated.
# 2  
Old 06-04-2010
# 3  
Old 06-04-2010
Thanks !
The issue of using that command is lets say the directory purge which is created on Jun 2 may have a file which is more than 60 days old. I don't want to delete it.

Aim is to delete the directories in /b03/purge which is more than 60 days old.
# 4  
Old 06-04-2010
Based upon what? Modify time? Create time? Access time?
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

How to find and get a file in an entire directory with an excluded directory specified?

How to get a file 'zlib.h' in an entire directory with an excluded directory specified lives under that starting directory by using find command, as it failed on: $ find . -name 'zlib.h' -a -ipath 'CHROME.TMP' -prune -o -print it'll just list entirely up (2 Replies)
Discussion started by: abdulbadii
2 Replies

2. Shell Programming and Scripting

Menu for Purge

I have these commands that help me find and delete files over certain days. How can I build a menu to list the files, and then hit y for yes to delete or no? find /logs/212/abinitio/prod/mfs/partitions/part0/mfs_12way_001/mfs_12way/sncrpt/main/ -name "*dat" -mtime +1 -exec ls -ltr {} \; find... (3 Replies)
Discussion started by: xgringo
3 Replies

3. Shell Programming and Scripting

Find every directory named XYZ under the DVLP directory

I only want to find files under each branch of the directory tree inside directories named XYZ and there are multiple XYZ directories? (7 Replies)
Discussion started by: emc^24sho
7 Replies

4. Emergency UNIX and Linux Support

Purge in oracle9i

From morning we are facing some issues in tablespaces in oracle9i. Tried deleting some huge records... but even thought it is still giving tablespcases in full. Then i tried and googling ... found we need to purge recyclebin of oracle.. but thats not woking in oracle9i... can any one... (1 Reply)
Discussion started by: greenworld123
1 Replies

5. UNIX for Advanced & Expert Users

Purge MAil file

Hi, merry christmas. on AIX 6.1, the file /var/spool/mail/user, should/can be purged manually ? Any commande line to purge it ? Thanks. (2 Replies)
Discussion started by: big123456
2 Replies

6. UNIX for Dummies Questions & Answers

Script to find a string in a directory/sub-directory

I'm trying to find this string 'preparing string IBE_Quote_W1_Pvt.SaveWrapper for quote_header_id’ in my Apache log file directory. The log file that contains this string may be in a parent direcotry or a sub-directory. I have tried 'grep' and 'awk' with no success. I would like to get the path... (3 Replies)
Discussion started by: gross
3 Replies

7. UNIX for Dummies Questions & Answers

how to find a file named vijay in a directory using find command

I need to find whether there is a file named vijay is there or not in folder named "opt" .I tried "ls *|grep vijay" but it showed permission problem. so i need to use find command (6 Replies)
Discussion started by: amirthraj_12
6 Replies

8. Shell Programming and Scripting

script for purge

Hi , I want to purge 7 days older data from a list of data sorted on date in a log file... Can anyone provide me with the shell script for the same.. Thanks, Jaz (1 Reply)
Discussion started by: JP003
1 Replies

9. UNIX for Dummies Questions & Answers

Find and purge a files in a dir

HI All, I have recuirement to purge the files in a directory . In that directory i an having many sub-directory . When i use find command like find ~/work/test/insert -name "*.*" -mtime +12 it is listing the file not accesed before 12 , It also takes the subdirectories inside the... (7 Replies)
Discussion started by: arunkumar_mca
7 Replies

10. UNIX for Dummies Questions & Answers

purge xterm

Being new I had my focus in the wrong place and typed in xterm instead of <If you can't guess, good>. Can I purge xterm so that this word no longer appears using up or down arrows? (1 Reply)
Discussion started by: noobie_doo
1 Replies
Login or Register to Ask a Question

Featured Tech Videos