The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

I need to send raw logs daily via cron to my client

Discussion in 'General Discussion' started by dianaward, May 8, 2003.

  1. dianaward

    dianaward Well-Known Member

    Joined:
    Dec 9, 2002
    Messages:
    99
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    USA
    cPanel Access Level:
    Root Administrator
    Twitter:
    Can someone Please tell me how to do this, in newbie detail?
     
  2. cev

    cev Member

    Joined:
    Apr 10, 2002
    Messages:
    17
    Likes Received:
    0
    Trophy Points:
    1
    hi

    did you got a solution for that? i'm also interested in this.

    rony

    cPanel.net Support Ticket Number:
     
  3. pirania1

    pirania1 Well-Known Member

    Joined:
    May 10, 2003
    Messages:
    126
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Miami, FL
    I scripted custom solution for my customer, that sends logs from subscription/unsubscription (mailman) via email.
    I did it via logrotate.
    If you specify what logs you want to send.. (exact paths in your case) I'll check what I can do.

    cPanel.net Support Ticket Number:
     
  4. cev

    cev Member

    Joined:
    Apr 10, 2002
    Messages:
    17
    Likes Received:
    0
    Trophy Points:
    1
    hi

    i need it for the raw log files (httpd), but i have no idea where the user log files are saved, i searched for them but didn't got no answer, also no at this forum yet.

    if someone can help out with this would be great.

    rony

    cPanel.net Support Ticket Number:
     
  5. pirania1

    pirania1 Well-Known Member

    Joined:
    May 10, 2003
    Messages:
    126
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Miami, FL
    Ok. Here you go..
    If you are newbie, I don't recommend you to play with it since I GIVE NO WARRANTY WHATSOEVER. IF IT ERASES YOUR WHOLE COMPUTER IT'S YOUR EXPLICIT RESPONSIBILITY.

    That is just to give you an idea how it can be done.

    Ok. First we create the script file:
    Let's call it "0sendlog-somedomain.com"
    as root: type pico /root/0sendlog-somedomain.com
    Then type this:
    Code:
    #!/bin/sh 
    uuencode /usr/local/apache/domlogs/<domainname> apachelog.txt | /bin/mail -s "Daily Website log" [email]somebody@somewhere.com[/email]
    
    Make sure it's only those 2 lines and that this "uuencode" line doesn't wrap up.

    Replace <domainname> with name of domain you want to send logs for (of course without <>). Also somebody@somewhere.com should be the email address you want to send it to :P
    Press ctrl+x to save it.

    if you want to test it, type sh /root/0sendlog-somedomain.com
    If it works fine then simply add it to cron to run at specific hour

    I guess it can be also used directly as a command for crontab, but I didn't tested and and since I use many domains in one script, I didn't really wanted to clutter crontab entries.
     
    #5 pirania1, Jun 3, 2003
    Last edited: Jun 3, 2003
Loading...

Share This Page