Here's a korn shell script that I use on my fax server to cleanup the
files in the working dir. It removes any files older than 2 days. (We do
a lot of faxing :) ) You'll need to tweak it a bit, but this works for
me.
#!/bin/ksh
#
# cleanup.sh Daily cleanup of fax system directories
#
cd /wrk/faxes
find . -type f ! -mtime -2 -exec rm {} \;
cd /home/vsifax/logs
find . ! -mtime -10 -exec rm {} \; >/dev/null 2>&1
find . -size 0 -exec rm {} \; >/dev/null 2>&1
I'm sure there's a more elegant way.
HTH,
Wayne
Kevin Wood wrote:
> I was wondering if anyone knew of a good command that would help me
> determine if a file was older than a specified date. The reason I need
> this is that I am doing some botched versioning control and I need to move
> files that are dated older than 30 days off to another directory. Does
> someone have a script or a good command to do this?
_______________________________________________
Redhat-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-list