[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



> 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