Skip to main content

Exclude mail folder from backup for all accounts

Comments

11 comments

  • Arvy
    Ah, sorry, cannot edit subject: "Exclude mail folder FROM BACKUP for all accounts "
    0
  • cPanelMichael
    Hello :) There's a document explaining how to exclude files from backups at: How to Exclude Files From Backups - cPanel Knowledge Base - cPanel Documentation You may want to further isolate which directories are excluded because the "mail" directory includes the proper directory structure that's required for users to access their email accounts. Thank you.
    0
  • Arvy
    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!
    0
  • cPanelMichael
    My advice is to not exclude the mail data, because with only 30 days of storage, it should not result in excessive disk space usage. If you choose to do so, you could utilize a local exclude file for individual accounts: How to Exclude Files From Backups - cPanel Knowledge Base - cPanel Documentation Then, enter the actual directory names you want to exclude. Thank you.
    0
  • WebHostPro
    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.
    0
  • cPanelMichael
    New Any luck finding out how to do this?

    You can use a local exclude file to exclude specific directories from backup generations, as documented here: How to Exclude Files From Backups - cPanel Knowledge Base - cPanel Documentation Thank you.
    0
  • WebHostPro
    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?
    0
  • cPanelMichael
    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.

    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.
    0
  • jonathanlafleur
    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.
    0
  • WebHostPro
    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.
    0
  • cPanelMichael
    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:
    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.
    0

Please sign in to leave a comment.