Archive for the tag 'cronjob'

SBDavid

How to add rkhunter to a cronjob

How to add rkhunter to a cronjob

we know that automation and email notification make an administrator’s life a lot easier, so now we can add rkhunter to a cronjob.

This is straight from the rkhunter website: You need to create a short shell script as follows:

#!/bin/sh

( /usr/bin/rkhunter –versioncheck
/usr/bin/rkhunter –update
/usr/bin/rkhunter –cronjob –report-warnings-only
) | /usr/bin/mail -s “rkhunter output” admin@yourdomain.com

Save the file and call it something like ‘rkhunterscript’. Make the file executable:

chmod 750 rkhunterscript

and place it in your local bin folder or in a public bin folder. Now set a root cronjob as follows:

sudo crontab -e

cronjob looks like this:

10 3 * * * /home/demo/bin/rkhunterscript

This will run the script at 3.10am each day