Skip to main content

Question about cpbackup-exclude.conf

Comments

17 comments

  • wtsdyo
    Question about backups, I see that during the nightly backups the homedir first gets copied to the cpbackup/daily/account/ folder before it gets tar'd. Are the files/folders in the cpbackup-exclude.conf file also gets copied or are they already ignored by the file copy script? Or are the excluded files only get ignored by the tar process? Two of our accounts have a temporary folder that contains a large number of files and folders. These temporary folder get changed a lot (subfolders and files get removed/created as their individual cache time expires). We already have listed this temporary folder in the cpbackup-exclude.conf for that account. The problem is that the nightly backup process is taking too much time to complete. I suspect that the culprit is the temporary folder. There are lots of "....." lines after the "Copying homedir" line in the backup log but only a few lines after the "Creating Archive" line. So this looks, at least to me, that most of the time is spent on copying the home folder. Is my assumption correct? If so, can anyone suggest how I can instruct cpbackup's homedir copy script to do not copy this temporary folder? Is there a setting for this? I am also thinking of moving the temporary folder into a separate location and then just creating a symlink so that our scripts can still locate the temporary folder. Will cpbackup's homedir copy script follow these symlinks? Thanks!
    0
  • cPanelPeter cPanel Staff
    Hello, Files and directories in cpbackup-exclude.conf will get skipped from both tar and gzip. Here is the documentation on how to use cpbackup-exclude.conf
    0
  • luigidelgado
    Peter, How would I set in /etc/cpbackup-exclude.conf to exclude any kind of */cache* files or directories? just like that? */cache*
    ?
    0
  • cPanelMichael
    [quote="luigidelgado, post: 1732332">Peter, How would I set in /etc/cpbackup-exclude.conf to exclude any kind of */cache* files or directories? just like that? */cache*
    ?
    Yes, however you should likely restrict it to your public_html directories. EX: public_html/cache/*
    Thank you.
    0
  • luigidelgado
    Ok... In the case caches are in a subdirectory inside public_html (for example: public_html/subdir/cache) would that work? Or should I use public_html/*/cache/* ?
    0
  • cPanelMichael
    You could add an additional entry: public_html/cache/* public_html/*/cache/*
    Thank you.
    0
  • speckados
    Hi.
    0
  • cPanelMichael
    Hello, If the files are stored in the account's home directory, then you should remove the initial wildcard from your entry. EX: backup-*tar.gz Thank you.
    0
  • speckados
    A lot of thanks.
    0
  • WCAndrew
    So to exclude all files and directories in an account's home directory, the contents of /home/example_account/cpbackup-exclude.conf would just be: *
    Is that right? That would be because I only want to backup the account's database(s).
    0
  • cPanelMichael
    Is that right? That would be because I only want to backup the account's database(s).

    Hello, Yes, that would exclude all files from the account's home directory. Thank you.
    0
  • WCAndrew
    Thanks. Also I am wanting to exclude the e.g. /home/example_account/mail folder and everything inside the mail folder on every account in /home So I edited /etc/cpbackup-exclude.conf and added mail/* ... and I checked my backups this morning and the /home/example_account/mail folders have still been added to the accounts. What do I put in /etc/cpbackup-exclude.conf to exclude /home/example_account/mail and all files and sub-folders please?
    0
  • WCAndrew
    Re. my above post. That has actually worked as I intended, I tried to edit or delete the above post and the system wouldn't allow me to. Thanks.
    0
  • cPanelMichael
    Re. my above post. That has actually worked as I intended, I tried to edit or delete the above post and the system wouldn't allow me to. Thanks.

    I am happy to see it worked as expected. Thank you for updating us with the outcome.
    0
  • hfinlay10
    Hi, i am using cpbackup-exclude.conf to exclude /mail directory and subdirectory for most backups, but would like to include it in a less frequent backup (say fortnightly). Is there a command line way to get cpanel backup to ignore cpbackup-exclude.conf? Thanks.
    0
  • cPanelMichael
    Hi, i am using cpbackup-exclude.conf to exclude /mail directory and subdirectory for most backups, but would like to include it in a less frequent backup (say fortnightly). Is there a command line way to get cpanel backup to ignore cpbackup-exclude.conf? Thanks.

    You could temporarily remove the exclusions and force a backup generation via: /usr/local/cpanel/bin/backup --force
    Thank you.
    0
  • Optimizr
    Sorry to bump up the old thread but this seems to be a good place to add up my questions too. I am, in fact, looking for a include setting. For example, incase of WordPress sites, I would exclude */wp-*
    but then I would include wp-content
    and wp-config.php
    because those two and database are the only things that matter for a WordPress site. But by allowing me to do so, my cpbackup-exclude.conf would be much cleaner and easier to read. My another question is if I can add comments in cpbackup-exclude.conf by preceding a hash sign (#) like a regular .conf file? I am asking this because my hosting size is big and can't risk to break the backup process. Thank you.
    0

Please sign in to leave a comment.