I am new to Linux and I want to have a script to run ClamAV on my entire system, write it to a log file, then shut down after it is done (since I will be running it before I go to bed). I already made it executable. This is what I have so far:
~!/bin/bash
sudo clamscan -r -i / > clamav.log
poweroff
#!/bin/bash
not~
. Instead of usingsudo
in scripts, run the script withsudo
. ClamAV runs as a daemon and writes a log by default whenever it runs. You do not need to manually run it./var/log/clamav