#! /bin/sh for d in /tmp /var/tmp /var/preserve do if [ ! -d $d ] then echo $d not found continue fi cd $d find . ! -name . ! -name lost+found -type f -mtime +7 -exec rm -f {} \; find . ! -name . ! -name lost+found -type l -mtime +7 -exec rm -f {} \; find . ! -name . ! -name lost+found -type s -mtime +7 -exec rm -f {} \; find . ! -name . ! -name lost+found -type d -mtime +1 -exec rmdir {} \; doneを /usr/local/sbin/root.day として置き、 cron に登録する
linkstationVine# crontab -l # DO NOT EDIT THIS FILE - edit the master and reinstall. # (/tmp/crontab.599 installed on Wed Dec 16 02:39:03 2003) # (Cron version -- $Id: crontab.c,v 2.13 1994/01/17 03:20:37 vixie Exp $) 0 2 * * * /bin/sh /usr/local/sbin/root.day 2>/dev/null 1> /dev/nulltmpwatch でもいいのだが、、、