Computing.Net > Forums > Unix > Korn shell script help !

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Korn shell script help !

Reply to Message Icon

Name: iyer
Date: December 5, 2005 at 08:15:21 Pacific
OS: Windows
CPU/Ram: compaq
Comment:

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



Sponsored Link
Ads by Google

Response Number 1
Name: nails
Date: December 5, 2005 at 13:48:57 Pacific
Reply:

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.


0
Reply to Message Icon

Related Posts

See More







Post Locked

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


Go to Unix Forum Home


Sponsored links

Ads by Google


Results for: Korn shell script help !

korn shell script help www.computing.net/answers/unix/korn-shell-script-help/3815.html

Korn Shell script help please!! www.computing.net/answers/unix/korn-shell-script-help-please/4345.html

Korn shell script doubt ??? www.computing.net/answers/unix/korn-shell-script-doubt-/3407.html