[shell] find command

Check $path folder for the files that are older that 7 days and delete them.

 find $path 2>>$DLOG -mtime +7 ! -exec rm -rf {} \;

check man page

Read More

[Redhat/Fedora] Sendmail smrsh ? Forwarding email to a program

By default, Redhat & Fedora comes with smrsh activated.
In order to forward an email to a handler program, the handler program must be in /etc/smrsh (I am not sure if link is sufficient)

Refer to /etc/mail/sendmail.mc
Below line means that smrsh is used.

FEATURE(`smrsh',`/usr/sbin/smrsh')dnl

/etc/aliases

localemail:  |/etc/smrsh/mailhandler.sh

run newaliases to update the aliases db.

Also the /etc/smrsh/mailhandler.sh should read the input from the STDIN.

Read More