hi,
can have help with crontab to run weekly![]()
hi,
can have help with crontab to run weekly![]()
@Thelunatic
The necessary cron for weekly run is :
This will run each Sunday as per instructed, of course you can always change the name of the script if your bash file is elsewhere and it probably is.0 15 * * 0 /root/chkrootkit-weekly.sh
Hope this helps you in any way.
Hi man...
i create this script.... i still a few hours to make that.. i am not find that in any site (the combination ha)
you change cron.daily to weekly
nano /etc/cron.daily/rkhunter.sh
then in rkhunter.sh put this code:
#!/bin/bash
(/usr/local/bin/rkhunter --checkversion
/usr/local/bin/rkhunter --update
/usr/local/bin/rkhunter -c -sk
/usr/local/bin/rkhunter --cronjob --report-warnings-only) | mail -s "Server XXX Weekly Report" support@yourdomain.com
then run this (change daily for weekly)
chmod +x /etc/cron.daily/rkhunter.sh
then make a test (change daily for weekly)
sh /etc/cron.daily/rkhunter.sh
rkunter has an inderface for cpanel you can set the cron from there.
The Rkhunter WHM Interface » Scriptmantra
I also tried to setup a cronjob for Chkrootkit-0.49
When I run it manualy it run okay cd /root/chkrootkit-0.49 ==> ./chkrootkit
I Made the cronjob in /etc/cron.daily
#!/bin/bash
cd /root/chkrootkit-0.49/
./chkrootkit | mail -s "chkrootkit Scan." host@myserver.com
but I become this message
/etc/cron.daily/chkrootkit.sh:
/etc/cron.daily/chkrootkit.sh: line 3: mail: command not found
Is there someone with a answer.
Tom
Change to the path for mail instead:
Code:./chkrootkit | /bin/mail -s "chkrootkit Scan" host@myserver.com
cPResources: Support Options | More Support Options | Forums Search | cPanel.net Site Search | Mailing Lists(Alt) | Docs
-- Tristan, Forums Technical Analyst, cPanel Tech Support
Submit a ticket | Check an existing ticket
I changed it to
but tested with:Code:./chkrootkit | /bin/mail -s "chkrootkit Scan" host@myserver.com
gave meCode:sh /etc/cron.daily/chkrootkit.sh
Code:/etc/cron.daily/chkrootkit.sh: line 3: /bin/mail: No such file or directorymail: /etc/mailCode:# whereis mail
but in the mail directory is only spamassassin
When I do "whereis mail", I show the following:
Run this command to see the output:Code:root@host [~]# whereis mail mail: /bin/mail /etc/mail.rc /etc/mail /usr/lib/mail.tildehelp /usr/lib/mail.help /usr/share/man/man1/mail.1.gz
If you show the rpm, then remove it:Code:rpm -qa | grep -i mailx
Now, reinstall it:Code:rpm -e --nodeps mailx
After that, check if /bin/mail now exists:Code:yum -y install mailx
Code:ls -lah /bin/mail
cPResources: Support Options | More Support Options | Forums Search | cPanel.net Site Search | Mailing Lists(Alt) | Docs
-- Tristan, Forums Technical Analyst, cPanel Tech Support
Submit a ticket | Check an existing ticket
It Works perfect