Create cron job for maldet scanning

first you need to edit maldet monitor path

for that to to /usr/local/maldetect/monitor_paths

#add your paths for scanning 
/home
/etc
/var/www/

then save that

go to home

I am using root so my directory is /root

then create maldet.sh and edit

#start maldet service
systemctl start maldet.service
#start maldet monitor
maldet --monitor /usr/local/maldetect/monitor_paths

above command will enable maldet service and run monitor to the paths which is already mentioned

now edit cron job

sudo crontab -e

if you are using first time it will ask for your edit which you want to access cron job, i am using nano, which is easier.

if you messed up by selecting wrong editor ?

No problem, use this link to refix.

https://docs.techridez.com/techridez/devops/webdev/cron-job/how-to-change-default-crontab-editor

as you can see only one command is there which is uncommented, every day at 23 Hours this will triger maldet scanning.

enjoy.

Last updated

Was this helpful?