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.

Exclude mail folder from backup for all accounts

Discussion in 'Data Protection' started by Arvy, Jan 25, 2016.

  1. Arvy

    Arvy Well-Known Member

    Joined:
    Oct 3, 2006
    Messages:
    92
    Likes Received:
    3
    Trophy Points:
    8
    Location:
    Brazil
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hi there!

    How to exclude the mail folder from the backups but don't lost information about accounts (mail accounts, passwords, etc)? So, in a disaster recover (hd crash) cPanel will restore everything, including mail accounts and passwords, but not the email messages, webmail user folders, etc?

    My users use only POP3, and they're adviced that cannot store remote email. But most users let 30 days of messages in the server to sync with cellphone, and I don't want to lost backup space with this.

    I read about edit "/etc/cpbackup-exclude.conf" and add a single line "mail" at end. But I'm not sure if this is right and enough for what I need.

    Thanks!
     
  2. Arvy

    Arvy Well-Known Member

    Joined:
    Oct 3, 2006
    Messages:
    92
    Likes Received:
    3
    Trophy Points:
    8
    Location:
    Brazil
    cPanel Access Level:
    Root Administrator
    Twitter:
    Ah, sorry, cannot edit subject:

    "Exclude mail folder FROM BACKUP for all accounts "
     
  3. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,832
    Likes Received:
    672
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
  4. Arvy

    Arvy Well-Known Member

    Joined:
    Oct 3, 2006
    Messages:
    92
    Likes Received:
    3
    Trophy Points:
    8
    Location:
    Brazil
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello Michael,

    that's the link I read. My idea is backup everything except the email messages. So, if I need to restore the machine from backups, users will still use POP/SMTP with their old passwords, but if access the webmail, will have no old messages, like a new mail account.

    Which folders I need to exclude then? Probably "new" and "cur" folders. How can I configure cpbackup-exclude.conf for this?

    Thanks!
     
  5. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,832
    Likes Received:
    672
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
  6. DWHS.net

    DWHS.net Well-Known Member
    PartnerNOC

    Joined:
    Jul 28, 2002
    Messages:
    1,569
    Likes Received:
    6
    Trophy Points:
    38
    Location:
    LA, Costa RIca
    cPanel Access Level:
    Root Administrator
    Any luck finding out how to do this?

    Thanks for the advice not to do this, but the time to restore emails is drastic when a restore is needed. We would prefer to back up email another way. Most emails are just junk people don't care about anyways that will take hours to restore that could be utilized to get accounts back quickly.
     
  7. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,832
    Likes Received:
    672
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
  8. DWHS.net

    DWHS.net Well-Known Member
    PartnerNOC

    Joined:
    Jul 28, 2002
    Messages:
    1,569
    Likes Received:
    6
    Trophy Points:
    38
    Location:
    LA, Costa RIca
    cPanel Access Level:
    Root Administrator
    Thanks I read it but I still don't understand exactly.

    Can you give an example?

    1. I would look at the back up directory.
    2. Check the server to see if each username is still there.
    3. Then I would add the /home/username/ to the back up exclude file?

    This is better then just deleting the account's directory because you don't have to wait for the folder to be deleted?

    This is the best way as of now right?
     
  9. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,832
    Likes Received:
    672
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    If you are backing up email through another method, you could simply backup the full "/home/$username/mail" directory for each account using whichever backup method you prefer, and then exclude that directory from backups by adding this line to the /etc/cpbackup-exclude.conf file:

    mail

    Thank you.
     
  10. jonathanlafleur

    Joined:
    Oct 8, 2013
    Messages:
    16
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    New Richmond
    cPanel Access Level:
    Root Administrator
    Twitter:
    Any luck here ? My clients are advised that I'm not responsible for email lost. They have to backup them email on their own. The problem is that I have client with 10GB of email. I was really tolerant from many years, but my backup process now take 16 hours to complete. So I want to remove email from backup. My only problem is that like it's being already stipulated I do want a full restore to at least reinstall mailbox with password. In the event that my server crash and I need to reinstall 130 clients, I don't want to add back all them email account, but I will not take care of them email data.

    From the inside of every account I see this :

    .Archive
    courierimapkeywords
    courierimapsubscribed
    courierimapuiddb
    courierpop3dsizelist
    cur
    dovecot-acl-list
    dovecot.index
    dovecot.index.cache
    dovecot.index.log
    dovecot.index.log.2
    dovecot-keywords
    dovecot.list.index
    dovecot.list.index.log
    dovecot.mailbox.log
    dovecot-quota
    dovecot-uidlist
    dovecot-uidvalidity
    dovecot-uidvalidity.5603358b
    .Drafts
    .Junk
    maildirsize
    new
    .Notes
    .Sent
    .spam
    subscriptions
    tmp
    .Trash


    what is needed inside of this to make sure it recreate the account ? Do I just add "mail" to cpbackup-exclude.conf or do I have to add

    mail/*/.Archive
    mail/*/courerimapkeywords
    ...

    and just omit certain important files to make sure it recreate the account ?

    Thank you.
     
  11. DWHS.net

    DWHS.net Well-Known Member
    PartnerNOC

    Joined:
    Jul 28, 2002
    Messages:
    1,569
    Likes Received:
    6
    Trophy Points:
    38
    Location:
    LA, Costa RIca
    cPanel Access Level:
    Root Administrator
    Yeah exactly, it just makes restoring back ups take an extra 10-15 hours on a full server. I would rather have an easy way for customers to back up mail or a manual way in the WHM. To do it in the backups makes a bad situation horrible.

    And no I haven't found a way to block it yet. rsync doesn't allow the formats that email uses to name files. The names are like 124.554.username.344.mail some crazy stuff like this, I can't tell rsync to ignore.
     
  12. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,832
    Likes Received:
    672
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello @jonathanlafleur,

    The email account information is stored in the account's "/home/$username/etc" directory, so you'd want to exclude the files within each directory that includes actual email data. Here's an example of how the lines would look in the cpbackup-exclude.conf file:

    Code:
    mail/*/*/cur/*
    mail/*/*/new/*
    Add additional entries for any other directories where email is stored (e.g. .Junk, .Sent). I also encourage you to open a feature request for the ability to manage email exclusion via an option in the UI:

    Submit A Feature Request

    Thank you.
     
Loading...

Share This Page