clam scan in background?

dragon2611

Verified User
Joined
Nov 26, 2004
Messages
76
how to i get a clamscan to run in the background then email me the results
so that i dont have to remain connected to ssh when its running

i tryed

screen clamscan -r -i / > [email protected]

and it did the scan the box but it never emailed me the output.
 
Check the directory where you ran it from, and I'd bet you'll find a file named "[email protected]" unix/linux has no problems with "@" signs in a filename.

If there is, then this might work (I say might because I haven't had time to read the screen manpage in a while):
Code:
screen clamscan -r -i / > /tmp/clamscan.out ; mail [email][email protected][/email] < /tmp/clamscan.out ; rm /tmp/clamscan.out
If it doesn't work as a one liner try it as three separate lines (separate the lines at the ";" and don't include the ";") in a script and run the script.

And if that doesn't work, then leave out the leading "screen ", and run the script this way:

./scriptname.sh &

where the & will cause it to run in the background.

Jeff
 
Back
Top