Files to exclude from each domain

The "Files to exclude from each domain" in Scheduled Backups has the following explanation:

This field allows you to enter the relative paths to files under each virtual server's home directory to exclude from this backup. For example, to skip Webalizer statistics, you could enter public_html/stats.

However, it is not clear:

  1. is it only for files or directories also? The example given (public_html/stats) is actually a directory. So maybe the feature's name should be changed to just "Exclude from each domain" or add both files and directories not to confuse users?

  2. should we separate each item by commas or enter an item per line?

  3. can we use wildcards like, for example:

*.gz, *.tar, *.zip, *.sql

Status: 
Closed (fixed)

Comments

I found the related issue which I created a while ago: https://www.virtualmin.com/node/38321

In addition to the above questions, I wonder would it exclude the directories in user's home on the level as public_html? For example, if there are directories like, for example,

backups/
public_html/
sandbox/

on the same level and we put them one per line without indicating public_html like:

backups
sandbox

would they be excluded?

You need to enter them one per line, and globs (like *.zip) as well as directory paths can be used.

Thanks, Jamie. Would be wonderful to update the Help info for the field.

I tried different methods and this worked perfectly.

Here is a solution:

Case I: Single Directory Exclude a directory from backups:

/home/example/public_html/docs/


Then syntax in "Files to exclude from each domain" should be:

public_html/docs


Case II: Multiple Directories Exclude multiple directories from backups:

/home/example/public_html/docs/
/home/example/public_html/var/
/home/example/domains/testbackups.example.com/public_html/media/cache/


Then syntax in "Files to exclude from each domain" should be:

public_html/docs
public_html/var
public_html/media/cache


Case III: Exclude file extensions

Exclude .exe .tar .tar.gz :


Then syntax in "Files to exclude from each domain" should be:

*.exe
*.tar
*.tar.gz


Case IV: All above cases at once

public_html/docs
public_html/var
public_html/media/cache
*.exe
*.tar
*.tar.gz


Note: These exclude files/directories are applicable globally for all websites/subdomains included in the backups. If you want to exclude the files/directories for website specific then you need to create schedule different backups for each domain.

There is also a per-domain setting for files and directories to exclude, which you can find on the left menu.

Joe's picture
Submitted by Joe on Sat, 06/16/2018 - 17:45 Pro Licensee

I'm gonna update the help for that option to include pragma's suggestions. That option does seem to be pretty confusing, since we get questions about it a lot.

Joe's picture
Submitted by Joe on Sun, 06/17/2018 - 15:14 Pro Licensee

Next release of Virtualmin has updated help for this option, which includes all of the use cases mentioned above (globs, multiple paths, files, etc.).

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.