Remove files older than 7 days...

Remove files older than 7 days...

Post by Jeffrey Hoo » Thu, 28 Dec 2000 04:32:28



I need to write a bash script that will remove all files older than 7
days from a dir...  and can't seem to figure out how to get the date part
to the find command...

Any help is appreciated...

JH

--

Jeffrey Hood
HM Consulting, Inc.
jhood [you-know-why] at hmcon.com

 
 
 

Remove files older than 7 days...

Post by Philipp Buehl » Thu, 28 Dec 2000 04:45:39


On Tue, 26 Dec 2000 19:32:28 GMT, Jeffrey Hood

>I need to write a bash script that will remove all files older than 7
>days from a dir...  and can't seem to figure out how to get the date part
>to the find command...

"older" is a little vague.. The date in 'ls -l' corresponds to what
'find -mtime' does.. So a find . -mtime +7 should be the point looking
for.

ciao
--
Philipp Buehler, aka fIpS | sysfive.com GmbH | BOfH | NUCH | <double-p>
%SYSTEM-F-TOOEARLY, please contact your sysadmin at a sensible time.
Artificial Intelligence stands no chance against Natural Stupidity.
        [X] <-- nail here for new monitor

 
 
 

1. How to remove the files that are 14 days or older?

Hi, All,
     I  want  to make  a cron job  that will automatically remove all
files that are 14 days or older and also  have a  file extension
of "tmp" . I am thinking of::

1.  Making  a new directory  daily based on  the date;
such as " DATE= 'date +%d';  mkdir  /tmp/$DATE "

2.  Moving  the files daily  into the /tmp/$DATE
"mv  /tmp/*.tmp  /tmp/$DATE"

3.  And when number of  /tmp/$DATE  reaches 14, it will remove the
olderst $DATE  in /tmp.

     I don't know how to do the third part. Please help.

                                            Parker

2. No 16bpp with >16mb ram?

3. remove files older than 2 days?

4. Look for Proxy Clinet software for RH Linux7

5. Howe to remove the files that are 14 days or older

6. Linux Web Server and Databases

7. Removing files older than # days

8. Linux v2.5.48

9. script to remove files older than 7 days

10. remove files older then # days

11. Q: how to 'rm' files older than x days

12. How to delete files older than 30 days ?

13. Need script to delete files older than 5 days