LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 10-08-2013, 09:26 PM   #1
poseidonsurf
Member
 
Registered: Feb 2013
Distribution: Slackware, Debian
Posts: 38

Rep: Reputation: Disabled
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?
 
Old 10-09-2013, 05:24 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,791

Rep: Reputation: 7304Reputation: 7304Reputation: 7304Reputation: 7304Reputation: 7304Reputation: 7304Reputation: 7304Reputation: 7304Reputation: 7304Reputation: 7304Reputation: 7304
sure, crontab can be used for scheduled tasks, it can start avgscan and mail the result.
 
Old 10-09-2013, 07:02 AM   #3
poseidonsurf
Member
 
Registered: Feb 2013
Distribution: Slackware, Debian
Posts: 38

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by pan64 View Post
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?
 
Old 10-09-2013, 07:08 AM   #4
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 3,474

Rep: Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553
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
 
1 members found this post helpful.
Old 10-09-2013, 02:02 PM   #5
poseidonsurf
Member
 
Registered: Feb 2013
Distribution: Slackware, Debian
Posts: 38

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by TenTenths View Post
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?
 
Old 10-09-2013, 09:20 PM   #6
poseidonsurf
Member
 
Registered: Feb 2013
Distribution: Slackware, Debian
Posts: 38

Original Poster
Rep: Reputation: Disabled
Anyone?
 
Old 10-10-2013, 02:49 AM   #7
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 3,474

Rep: Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553
Quote:
Originally Posted by poseidonsurf View Post
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.

Last edited by TenTenths; 10-10-2013 at 02:51 AM.
 
Old 10-10-2013, 11:04 AM   #8
poseidonsurf
Member
 
Registered: Feb 2013
Distribution: Slackware, Debian
Posts: 38

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by TenTenths View Post
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.
 
Old 10-10-2013, 11:10 AM   #9
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 3,474

Rep: Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553
Quote:
Originally Posted by poseidonsurf View Post
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.
 
Old 10-16-2013, 07:45 AM   #10
poseidonsurf
Member
 
Registered: Feb 2013
Distribution: Slackware, Debian
Posts: 38

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by TenTenths View Post
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Shell script/Perl Script to remove the string until it finds special character '_' pooppp Programming 10 07-17-2012 09:36 AM
Shell script/Perl Script to remove the string until it finds special character '_' pooppp Programming 1 07-13-2012 01:03 AM
Shell script, Perl script, command or utility to convert Binary to text Perseus Programming 26 07-12-2012 06:00 AM
[SOLVED] bash and xterm: how make apps started by and for a script persist when script terminates porphyry5 Linux - General 4 06-15-2011 01:27 PM
How to get full path to script file inside script itself? And in case of sym links? maggus Linux - Newbie 3 05-28-2009 08:40 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:54 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration