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.

Backing up Mail Delivery Reports

Discussion in 'Data Protection' started by scobiit, Nov 4, 2014.

  1. scobiit

    scobiit Member

    Joined:
    Sep 24, 2014
    Messages:
    19
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Hello,

    We have had a couple of occasions where we have needed to go back and look at the mail delivery reports on the server to find out that it has been longer than 30 days. I have seen in the settings we can extend this up to 365 days but am I right in thinking it reads the information from exim_mainlog? If so, is there a straight forward way (either via a bash script or a cron job) to back up the log files when they are rotated and modify the file name to keep them indefinitely (or until manually removed)?

    Thank you in advance.
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    653
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello :)

    Could you elaborate on the specific option you are referring to?

    Thank you.
     
  3. scobiit

    scobiit Member

    Joined:
    Sep 24, 2014
    Messages:
    19
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Hi Michael,

    yes of course, when you are logged in I went to:
    Tweak Settings >
    Stats and Logs >
    The interval, in days, to retain Exim stats in the database (Minimum: 1; Maximum: 365,000).

    Which from what I have read should retain the mail delivery information to show whether they have arrived at the destination server (either incoming or outgoing). Ideally we would want to have a way of backing this up so we can create an archive in case we have to refer back to them a few months down the line.

    Thanks again
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    653
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    The information that option is referring to is stored in the "eximstats" MySQL database. You could create a manual backup of this database if you prefer to not modify that option.

    Thank you.
     
  5. scobiit

    scobiit Member

    Joined:
    Sep 24, 2014
    Messages:
    19
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Hi again Michael,

    Thanks for that, you might be able to answer another query following on from the above.
    We have already sorted a remote backup to cover all of the home directory and attempted to create a cron job to back up the eximstats database to a subdirectory of home using mysqldump however it is behaving oddly. Although it does create a dump file it is only 280ish lines long however when I export the database via PHPMyAdmin it is over 40,000 lines? Is there a reason behind this?

    Thanks again
     
  6. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    653
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
  7. scobiit

    scobiit Member

    Joined:
    Sep 24, 2014
    Messages:
    19
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Hi Michael,

    I'm using as few options as I could as I just wanted to create a backup of all the tables. the command I used is below;

    mysqldump --user=root --databases eximstats > /home/eximstats/`date +\\%Y-\\%m-\\%d`_backup.sql

    Thanks again
     
  8. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    653
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    You can repair or optimize the "eximstats" database with commands such as:

    Code:
    mysqlcheck --repair eximstats
    mysqlcheck --optimize eximstats
    However, try reviewing the actual tables that are backed up through the "mysqldump" utility as it should backup all of the necessary data.

    Thank you.
     
  9. scobiit

    scobiit Member

    Joined:
    Sep 24, 2014
    Messages:
    19
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Hi Michael,

    I think we are getting our wires crossed a little on this. When I examine the dump files, it contains all the information required to recreate the tables but it is missing most of the lines of actual data which is what I want to back up. I have run the checks on eximstats anyway just to be on the safe side and none of the tables reported any errors.

    Thanks again
     
  10. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    653
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Feel free to open a support ticket using the link in my signature so we can take a closer look. You can post the ticket number here so we can update this thread with the outcome.

    Thank you.
     
Loading...

Share This Page