Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hi,
I am new to korn shell pgming..I need a script to do the following..
Delete all back up directories older than 30 days old
directory structure is like this: under main PROCESS dir, I have LOGS1, LOGS2...sub dir
LOGS1 dir will have current and LOGS1_12_1_2005, LOGS1_12_2_2005, LOGS1_12_3_2005 dir...
LOGS2 dir will have current and LOGS2_12_1_2005, LOGS2_12_2_2005, LOGS2_12_3_2005 dir...
similar with LOG3..
..
I have to delete all these LOGS1_12_1_2005, LOGS2_12_3_2005.. dir which are 30 days old in all sub dir of PROCESS.I really appreciate if anyone can help with this.
Thanks, Iyer.A

Use the find command:
find PROCESS/* -type d -mtime +30 -print|xargs rm -r
Make sure the find works the way you think it will work:
find PROCESS/* -type d -mtime +30 -print
before sticking the rm stuff on at the end.

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |