[ale] bash script

Marvin, International Martian of Mystery marvin.higginbottom at gmail.com
Tue Sep 11 10:18:31 EDT 2007


I'd like some feedback/critique for a script I'm running as a cron job
daily on a box I administrate.  It's supposed to delete all the files it
finds that are 5 days or older.  

This is what I've come up with:







#! /bin/sh

## Remove ZoneMinder events cache
## There's gotta be a better way  to
## do this!

EXECUTE="/usr/bin/find ./ ! -name "*.log" -mtime 5  -print | /sbin/rm
-Rf $1"


cd /var/www/zm/events/1
        $EXECUTE
cd /var/www/zm/events/2
        $EXECUTE
cd /var/www/zm/events/3
        $EXECUTE
cd /var/www/zm/events/5
        $EXECUTE
cd /var/www/zm/events/6
        $EXECUTE
cd /var/www/zm/events/9
        $EXECUTE
cd /var/www/zm/events/10
        $EXECUTE
cd /var/www/zm/events/11
        $EXECUTE
cd /var/www/zm/events/12
        $EXECUTE
cd /var/www/zm/events/13
        $EXECUTE
cd /var/www/zm/events/14
        $EXECUTE
cd /var/www/zm/events/15
        $EXECUTE




More information about the Ale mailing list