[..] Note, /etc/cron.daily/maldet should be changed for compatibility with Directadmin's structure of homedirs:
Code:#!/bin/bash # clear quarantine/session/tmp data every 14 days /usr/sbin/tmpwatch 336 /usr/local/maldetect/tmp >> /dev/null 2>&1 /usr/sbin/tmpwatch 336 /usr/local/maldetect/sess >> /dev/null 2>&1 /usr/sbin/tmpwatch 336 /usr/local/maldetect/quarantine >> /dev/null 2>&1 /usr/sbin/tmpwatch 336 /usr/local/maldetect/pub/*/ >> /dev/null 2>&1 # check for new release version /usr/local/maldetect/maldet -d >> /dev/null 2>&1 # check for new definition set /usr/local/maldetect/maldet -u >> /dev/null 2>&1 # if were running inotify monitoring, send daily hit summary if [ "$(ps -A --user root -o "comm" | grep inotifywait)" ]; then /usr/local/maldetect/maldet --alert-daily >> /dev/null 2>&1 else # scan the last 2 days of file changes if [ -d "/home/virtual" ] && [ -d "/usr/lib/opcenter" ]; then # ensim /usr/local/maldetect/maldet -b -r /home/virtual/?/fst/var/www/html 2 >> /dev/null 2>&1 /usr/local/maldetect/maldet -b -r /home/virtual/?/fst/home/?/public_html 2 >> /dev/null 2>&1 elif [ -d "/etc/psa" ] && [ -d "/var/lib/psa" ]; then # psa /usr/local/maldetect/maldet -b -r /var/www/vhosts/?/httpdocs 2 >> /dev/null 2>&1 /usr/local/maldetect/maldet -b -r /var/www/vhosts/?/subdomains/?/httpdocs 2 >> /dev/null 2>&1 elif [ -d "/usr/local/directadmin" ]; then # DirectAdmin /usr/local/maldetect/maldet -b -r /var/www/html/?/ 2 >> /dev/null 2>&1 /usr/local/maldetect/maldet -b -r /home?/?/domains/?/public_html 2 >> /dev/null 2>&1 else # cpanel, interworx and other standard home/user/public_html setups /usr/local/maldetect/maldet -b -r /home?/?/public_html 2 >> /dev/null 2>&1 fi fi
After I replaced the content of /etc/cron.daily/maldet with your edited version above, it give this error on email every night:
Code:
Anacron job 'cron.daily' on server.name.com
/etc/cron.daily/maldet:
/etc/cron.daily/maldet: line 1: !/bin/bash: No such file or directory