LINUX LITE 7.2 FINAL RELEASED - SEE RELEASE ANNOUNCEMENTS SECTION FOR DETAILS


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[SOLVED]cronjob for clamav
#1
Hi,
I'm trying to create a cron job for clamav to do a scan of the home directory once a week. I made this script in /etc/cron.weekly/ :
Code:
#!/bin/sh
clamscan -r /home/osamu/ | grep FOUND >> /home/osamu/virus-scan-reports/virus-scan-report.txt
following instructions from https://askubuntu.com/questions/749129/h...daily-scan.  I looked in crontab but can't see any evidence of a new job there:
Code:
# m h dom mon dow user    command
17 *    * * *    root    cd / && run-parts --report /etc/cron.hourly
25 6    * * *    root    test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )
47 6    * * 7    root    test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.weekly )
52 6    1 * *    root    test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.monthly )
#

Am I missing a step?  Is there a better way to achieve automatic weekly scans?

**edit:
I deleted the script in /etc/cron.weekly and instead added this cronjob to /etc/crontab
Code:
0 18 * * SUN root rm -rf /var/log/clamav/freshclam.log
1 18 * * SUN root freshclam
2 18 * * SUN root clamscan -r -i / | grep FOUND >> /home/osamu/virus-scan-reports/virus-scan-report.txt

This should update the malware database and scan  the entire system every sunday at 6pm and write it to a text file I hope.  Have I done this correctly and is there a way to dynamically append the current date to the name of the virus-scan text file?


Reply


Messages In This Thread
[SOLVED]cronjob for clamav - by osamu.morozumi - 05-05-2019, 07:41 AM
Re: [SOLVED]cronjob for clamav - by Valtam - 05-05-2019, 08:45 AM
Re: [SOLVED]cronjob for clamav - by Valtam - 05-05-2019, 12:10 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)