Cron and emailing logfiles

 
Post new topic   Reply to topic    34SP.com Forum Index // Email Support
View previous topic :: View next topic  
Author Message
scribbler
Junior Member
Junior Member


Joined: 13 Mar 2002
Posts: 116
Location: Hartlepool

PostPosted: Fri Jan 24, 2014 9:31 pm    Post subject: Cron and emailing logfiles Reply with quote
Not sure which subcategory this should be in, but mail seems like the best one.

I'm currently trying to find a way of mailing my access logs to gmail on a daily basis, and I thought the easiest way to do this was through a cronjob.

This is what I currently have...

Code:

mail -s "Access log GZ" -a /var/www/vhosts/DOMAIN/statistics/logs/*.gz email@address.com


I've just set this up, and it appears to email me the latest Gzipped log (which is what I want), but obvjously, it's untidy, and results in an error email immediately after...

Code:

/var/www/vhosts/DOMAIN/statistics/logs/DOMAIN-error_log-20140124.gz: Permission denied
/var/www/vhosts/DOMAIN/statistics/logs/DOMAIN-error_log-20140123.gz: Permission denied
/var/www/vhosts/DOMAIN/statistics/logs/DOMAIN-access_log-20140124.gz: Permission denied
Null message body; hope that's ok
"/var/www/vhosts/DOMAIN/./private/dead.letter" 2208/160369


Surely there must be a tidier way of doing what I want, or even, a better way of archiving these generated .gz files?
_________________
http://www.mercuryvapour.co.uk - Website is considered working unless I'm posting in here
Back to top
View user's profile Send private message Visit poster's website
Post new topic   Reply to topic    34SP.com Forum Index // Email Support All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Powered by phpBB © 2001, 2002 phpBB Group