LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Script (https://www.linuxquestions.org/questions/programming-9/script-4175480097/)

poseidonsurf 10-08-2013 09:26 PM

Script
 
I've installed AVG Anti-Virus on a Debian linux box. Is there a way to setup automated scan with the task scheduler and have it e-mail the report to an address?

pan64 10-09-2013 05:24 AM

sure, crontab can be used for scheduled tasks, it can start avgscan and mail the result.

poseidonsurf 10-09-2013 07:02 AM

Quote:

Originally Posted by pan64 (Post 5042695)
sure, crontab can be used for scheduled tasks, it can start avgscan and mail the result.

Thank you for the reply. I understand how to implement it in to crotab but how do I get the results mailed?

TenTenths 10-09-2013 07:08 AM

Put the following line above the job in your crontab and it will send any output from subsequent cron jobs to that e-mail.

Code:

MAILTO=your@email.addy

poseidonsurf 10-09-2013 02:02 PM

Quote:

Originally Posted by TenTenths (Post 5042731)
Put the following line above the job in your crontab and it will send any output from subsequent cron jobs to that e-mail.

Code:

MAILTO=your@email.addy

Do settings need to be setup for mail to be sent?

poseidonsurf 10-09-2013 09:20 PM

Anyone?

TenTenths 10-10-2013 02:49 AM

Quote:

Originally Posted by poseidonsurf (Post 5042959)
Do settings need to be setup for mail to be sent?

Settings in what?

In sendmail? No, not if your mail is working.
In crond? Not that I'm aware of.
In your AV? As long as it sends its results to stdout then they'll get mailed.

You need to be clear when asking questions like that.

poseidonsurf 10-10-2013 11:04 AM

Quote:

Originally Posted by TenTenths (Post 5043255)
Settings in what?

In sendmail? No, not if your mail is working.
In crond? Not that I'm aware of.
In your AV? As long as it sends its results to stdout then they'll get mailed.

You need to be clear when asking questions like that.

I apologize for not being more clear and thank you for getting back to me. Yes. I was referring to AV in the crontab. We don't have a mailbox set with smtp on the machine so I was just wondering how the mail gets forward to a different address.

TenTenths 10-10-2013 11:10 AM

Quote:

Originally Posted by poseidonsurf (Post 5043473)
I apologize for not being more clear and thank you for getting back to me. Yes. I was referring to AV in the crontab. We don't have a mailbox set with smtp on the machine so I was just wondering how the mail gets forward to a different address.

Ah, you will need some form of smtp transport such as postfix or sendmail running on your server for the mail to be sent to an address outside the server. I believe there are a few other resources out there that show how to get crond to use a different mailer but to be honest I've not looked in to that much.

You could also check your AV software, it may have a configurable option to mail any reports and it may have the option to use an external mail server.

poseidonsurf 10-16-2013 07:45 AM

Quote:

Originally Posted by TenTenths (Post 5043478)
Ah, you will need some form of smtp transport such as postfix or sendmail running on your server for the mail to be sent to an address outside the server. I believe there are a few other resources out there that show how to get crond to use a different mailer but to be honest I've not looked in to that much.

You could also check your AV software, it may have a configurable option to mail any reports and it may have the option to use an external mail server.

The AV software doesn't have anything built it but thank you for the response. I will try and figure something out.


All times are GMT -5. The time now is 12:28 PM.