Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: Unix questions - Please advice
> In my unix system (hp ux 10.20) I have one particular
> file will be generated from some applications every
> day.
>
> File name "MATERIAL.20020508225043"
>
> I usually deleted one month old files with <rm
> *200203*> command ( I need to keep last month files 04
> and delete all older than that). Can any one please
> help me writing a script to delete the files every
> month first date. so that I can put the script in cron
> job on every month 1st to delete more than one month
> old jobs.
If you have gnu date then:
glob=$(date --date='yesterday' +'MATERIAL.%Y%m*');
will work.
Why not just use find :
$datadir -mtime +30 | xargs rm -f;
to get rid of anything older than 30 days?
-- Steven Lembark 2930 W. Palmer Workhorse Computing Chicago, IL 60647 +1 800 762 1582 -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: INET: lembark_at_wrkhors.com Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051 San Diego, California -- Public Internet access / Mailing Lists -------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).Received on Thu May 09 2002 - 21:33:19 CDT
![]() |
![]() |