Need help with daily raw access logs being emailed via a cron

Asked by:
webster / 5 Points
Time:
2011-08-04 7:31 am EST
Category:
Cpanel
Hits:
3,295
I am trying to get my access logs emailed to a gmail account and it keeps giving me and error

tar: Removing leading `/' from member names

this is the code:
cd /home/user/access-logs
rm -f /home/user/accesS_logs.tar.gz
tar -zcvf /home/user/accesS_logs.tar.gz /home/user/access-logs/*
cd /home/user/
mutt -a accesS_logs.tar.gz myemail@gmail.com -s "RAW Log Backup" -f /home/user/mail_body

To ask this user for more information, please first login.

To submit an answer, please login.

Best answer chosen by Web Hosting Hub staff

0

bwmarkle
2011-08-04 4:07 pm EST
Hi webster,

I checked and mutt does not seemed to be installed on the servers, so this is why you're receiving an error message.

I tested a few options, and I was able to get the following cron command to work:

<div class="code_block">for i in `ls /home/user/access-logs/`; do mail -s "$i" "you@yourdomain.com" < /home/user/access-logs/$i;done;</div>

What this does is sends you a separate email for each file in the access-logs directory. The subject of the email is the log file name, and the body is the actual log.

I hope this helps!

Thanks,

- Brad

To submit a comment on this answer, please first login.

Want to share this Question?

Related Articles

It looks like there are no related articles.
Would you like to ask a question about this page? If so, click the button below!
Need More Help?

Help Center Search

Current Customers

Email: support@WebHostingHub.com Ticket: Submit a Support Ticket
Call: 757-416-6627 Chat: Click To Chat Now

Ask the Community

Get help with your questions from our community of like-minded hosting users and Web Hosting Hub Staff.

Not a Customer?

Get web hosting from a company that is here to help.
}