Fix cron jobs for dehydated & clamav
Bug report
Checklist
-
This issue is not a duplicate, I've searched the Issue Tracker -
This issue is not a question, I'm aware that I can submit questions via Mastodon, Twitter, Email, Reddit or Matrix -
This issue is a bug report, and not a content request, feature request, or anything other
What is the bug behavior?
Provided cron job instructions do not work for:
- Dehydrated
- ClamAV
What is the expected correct behavior?
-
Dehydrated cron job should run on a weekly basis to ensure Let's Encrypt's certificates are renewed 30 days before expiry
-
ClamAV cron job should run on a daily basis to scan for viruses
What are the steps to reproduce the bug?
Dehydrated:
crontab -e
0 8 1 * * root bash /etc/dehydrated/dehydrated -c
ClamAV:
crontab -e
0 18 * * * /usr/bin/freshclam
00 00 * * * root clamscan / -l /var/log/clamscan.log -r | mail -s "Clamscan Report" gofossadmin@localhost
What are possible fixes?
Dehydrated:
sudo touch /var/log/dehydrated
sudo vi /etc/cron.weekly/dehydrated
#!/bin/sh
MYLOG=/var/log/dehydrated
echo "Checking cert renewals at `date`" >> $MYLOG
/etc/dehydrated/dehydrated -c >> $MYLOG 2>&1
sudo chmod +x /etc/cron.weekly/dehydrated
ClamAV:
sudo touch /var/log/clamav/clamscan.log
sudo vi /etc/cron.daily/clamav
#!/bin/sh
MYLOG=/var/log/clamav/clamscan.log
echo "Scanning for viruses at `date`" >> $MYLOG
clamscan --recursive --infected --max-filesize=100M --max-scansize=100M --exclude=/boot / >> $MYLOG 2>&1
sudo chmod +x /etc/cron.daily/clamav
Do you have additional comments?
N/A