{"id":6371,"date":"2021-12-09T19:23:57","date_gmt":"2021-12-09T19:23:57","guid":{"rendered":"https:\/\/www.geekdecoder.com\/?p=6371"},"modified":"2021-12-09T19:23:57","modified_gmt":"2021-12-09T19:23:57","slug":"install-and-setup-clamav-on-debian-11","status":"publish","type":"post","link":"https:\/\/www.qbytes.cloud\/index.php\/2021\/12\/09\/install-and-setup-clamav-on-debian-11\/","title":{"rendered":"Install and Setup ClamAV on Debian 11"},"content":{"rendered":"<p>Install clamav<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n$ sudo apt-get install clamav clamav-daemon\n<\/pre>\n<p>Install this script to run a scan daily. Change the varables as needed.<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n#!\/bin\/bash\nLOGFILE=&quot;\/var\/log\/clamav\/clamav-$(date +'%Y-%m-%d').log&quot;;\nEMAIL_MSG=&quot;Please see the log file attached.&quot;;\nEMAIL_FROM=&quot;clamav-daily@example.com&quot;;\nEMAIL_TO=&quot;username@example.com&quot;;\nDIRTOSCAN=&quot;\/var\/www \/etc \/root \/home&quot;;\n\nfor S in ${DIRTOSCAN}; do\n DIRSIZE=$(du -sh &quot;$S&quot; 2&gt;\/dev\/null | cut -f1);\n\n echo &quot;Starting a daily scan of &quot;$S&quot; directory.\n Amount of data to be scanned is &quot;$DIRSIZE&quot;.&quot;;\n\n clamscan -ri &quot;$S&quot; &gt;&gt; &quot;$LOGFILE&quot;;\n\n # get the value of &quot;Infected lines&quot;\n MALWARE=$(tail &quot;$LOGFILE&quot;|grep Infected|cut -d&quot; &quot; -f3);\n\n # if the value is not equal to zero, send an email with the log file attached\n if &#x5B; &quot;$MALWARE&quot; -ne &quot;0&quot; ];then\n # using heirloom-mailx below\n echo &quot;$EMAIL_MSG&quot;|mail -a &quot;$LOGFILE&quot; -s &quot;Malware Found&quot; -r &quot;$EMAIL_FROM&quot; &quot;$EMAIL_TO&quot;;\n fi \ndone\n\nexit 0\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Install clamav $ sudo apt-get install clamav clamav-daemon Install this script to run a scan daily. Change the varables as needed. #!\/bin\/bash LOGFILE=&quot;\/var\/log\/clamav\/clamav-$(date +&#8217;%Y-%m-%d&#8217;).log&quot;; EMAIL_MSG=&quot;Please see the log file attached.&quot;; EMAIL_FROM=&quot;clamav-daily@example.com&quot;; EMAIL_TO=&quot;username@example.com&quot;; DIRTOSCAN=&quot;\/var\/www \/etc \/root \/home&quot;; for S in ${DIRTOSCAN}; do DIRSIZE=$(du -sh &quot;$S&quot; 2&gt;\/dev\/null | cut -f1); echo &quot;Starting a daily scan of &quot;$S&quot; &#8230; <a title=\"Install and Setup ClamAV on Debian 11\" class=\"read-more\" href=\"https:\/\/www.qbytes.cloud\/index.php\/2021\/12\/09\/install-and-setup-clamav-on-debian-11\/\" aria-label=\"Read more about Install and Setup ClamAV on Debian 11\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[56],"tags":[],"class_list":["post-6371","post","type-post","status-publish","format-standard","hentry","category-kb"],"_links":{"self":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/posts\/6371","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/comments?post=6371"}],"version-history":[{"count":0,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/posts\/6371\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/media?parent=6371"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/categories?post=6371"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/tags?post=6371"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}