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.

cpbackup-exclude.conf question.

Discussion in 'Data Protection' started by RyokoX, Mar 20, 2015.

  1. RyokoX

    RyokoX Registered

    Joined:
    Mar 20, 2015
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Bulgaria
    cPanel Access Level:
    Root Administrator
    Hello Everyone,

    I'm struggling with making this work, and any suggestions are greatly appreciated.

    With my current setup, /etc/cpbackup-exclude.conf is configured to exclude all public_html directories as those are backed up via another method which is not relevant to the issue.

    Is there any possibility to keep using the main cpbackup-exclude.conf in /etc/ to exclude the directories from being backed up by the server-wide backups done from WHM, while still retaining the ability for my users to generate full cPanel backups including the public_html directories from their accounts using the backup wizard?
     
  2. Alejandro P

    Alejandro P Well-Known Member

    Joined:
    Apr 6, 2007
    Messages:
    53
    Likes Received:
    0
    Trophy Points:
    6
    cPanel Access Level:
    Root Administrator
    Hello, I need something similar with an additional detail.

    I would like exclude not only the public_html but exclude all users homedir. One idea would be a custom backup script, but I would prefer to have this done via system cpbackup.

    Regarding your query, might you change the cron to include an alternate cpbackup-exclude.conf?

    Cron content might look like this backup_excluding.sh

    #!/bin/bash

    /bin/mv cpbackup-exclude.conf cpbackup-exclude.conf_default
    mv cpbackup-exclude.conf_excluding_public_html cpbackup-exclude.conf
    /usr/local/cpanel/scripts/cpbackup
    /bin/mv /etc/cpbackup-exclude.conf /etc/cpbackup-exclude.conf_excluding_public_html
    /bin/mv /etc/cpbackup-exclude.conf_default /etc/cpbackup-exclude.conf

    Then add a cron job like:
    0 3 * * 0 /root/backup_excluding.sh 2>&1

    /root/backup_excluding.sh should have 755 permission.
     
  3. Alejandro P

    Alejandro P Well-Known Member

    Joined:
    Apr 6, 2007
    Messages:
    53
    Likes Received:
    0
    Trophy Points:
    6
    cPanel Access Level:
    Root Administrator
    Hello, I have solved my request by adding * at the cpbackup-exclude.conf file.

    Along the process found this

    in

    https://documentation.cpanel.net/display/CKB/How+to+Exclude+Files+From+Backups

    It would be great if cpanel separate Cpanel account configuration from Cpanel Full backups, that way one could transfer just configuration and download, rsync or ftping the account Home Directory solving the problem of transfers in cases user account space is reduced.
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

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

    You can use the "--skiphomedir" flag with /scripts/pkgacct if you want to backup accounts through the command line, excluding the account's home directory. EX:

    Code:
    /scripts/pkgacct --skiphomedir test01
    Thank you.
     
Loading...

Share This Page