Aaron Straup Cope wrote:
> 
> Asks innocently : isn't this all a good candidate for a cron job? 

(Sorry for being late :-)

IMHO, yes. Carefully choose the age of the files to be cleaned up and a
script like this should work pretty fine:

#!/bin/bash

# AxKit Cache Directory
CACHEDIR=/opt/apache/cache

# Maximum age of files (30 days here)
MAXAGE=30

# You may prefer -mtime instead of -ctime here...
find $CACHEDIR -type f -ctime +$MAXAGE -exec rm -f {} \;

# The end

Please note that I'm writing this directly into the e-mail and I didn't
test it before writing. Running this script on a daily or weekly basis
should help to keep the cache clean from older files. It's not the best
criteria, but it may help :-)

My 2 cents ;)

--bronto

-- 
Marco Marongiu ([EMAIL PROTECTED])                   _  _  ____  __ __  
Networks & Computational Systems Service         | \| |/ ___)|  V  |
Network & System Management Area                 |    |\___ \|     | 
Phone: +39 070 2796 336                          |_|\_|(____/|_|V|_|

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to