[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [cobalt-users] help - making a cron job to auto delete files, earlier than a specific date
- Subject: RE: [cobalt-users] help - making a cron job to auto delete files, earlier than a specific date
- From: "Tim Lawson" <timl@xxxxxxxxxxxxxx>
- Date: Thu Aug 9 10:30:37 2001
- List-id: Mailing list for users to share thoughts on Cobalt products. <cobalt-users.list.cobalt.com>
> OK, it could go something like this:
>
> ------------cut below this line------------
> #!/bin/bash
>
> find /home/sites/site#/web/grunge -type f -ctime +15 | xargs rm
> ------------cut above this line------------
>
> Now cron it to run once a day and walla! 'yer done.
> There are other ways, but this is a low overhead approach.
> Other suggestions ladies and gentlemen????
Colin,
This looks like the goods.
I just changed the last line to read...
find /home/sites/www.domain.com.au/web/pdf -type f -ctime +15 | xargs rm
*.pdf
Assuming I put the correct 'www.domain.com.au' in the line instead, this
should delete all the files ending in '.pdf' if older than 15 days???
Now for possibly a stupid question, how can I, ummmmm, age some pdf files so
they are older than 15 days??? For testing purposes...
Regards
Tim Lawson