Applicable to:
- Plesk for Linux
- Plesk for Windows
Question
How to exclude specific files/directories from a backup in Plesk?
Answer
In order to exclude files from backup click to expand on the section
-
Go to Domains > example.com > Backup Manager > Back Up and use Exclude specific files
-
Only paths relative to the subscription can be used. For example:
CONFIG_TEXT: httpdocs/images/file.jpg
To exclude all files in the directory, use '*' mask, for example:
CONFIG_TEXT: httpdocs/images/*
To exclude a whole directory, specify the name of the directory, for example:
CONFIG_TEXT: httpdocs/images
Note: when excluding specific files from Full Server backup all files specified in Exclude specific files from the backup option on all domains will be excluded. It is not possible exclude specific file from specific domain only. Vote to implement features on Plesk User Voice Portal.
-
In Tools & Settings > Backup Manager > Back Up and use Exclude specific files from the backup option:
-
Only paths relative to the subscription should be used. For example:
CONFIG_TEXT: httpdocs/images/file.jpg
To exclude all files in the directory, use '*' mask, for example:
CONFIG_TEXT: httpdocs/images/*
To exclude a whole directory, specify name of the directory, for example:
CONFIG_TEXT: httpdocs/images
Comments
39 comments
Hi !
Since excluded files/folders have to be relative paths only, how to exclude a folder from a full server backup if the name of the folder exists for another subscription?
I want to exclude "/var/www/domain-first.tld/data/pictures" but there a "pictures" folder in "/var/www/domain-second.tld/data/pictures".
Will the both folders be excluded from full server backup?
Thanks.
+1 for the file explorer/picker but anyone has an answer for my question? https://support.plesk.com/hc/en-us/articles/115000773605/comments/360002567539
How do I exclude a path from the server-side, so that later backups I don't have to add that path to the exclude entry?
I have the same issue at @Lmt.
We're using a Web Admin license and it seems all backups need to be done from the main account login (as the system/server admin).
We have mydomain1.tld, mydomain2.tld, etc. On some of the domains we have large media files that we don't need backed up.
/httpdoc/media/*
But only on one of the domains. On the other domains we do want to back up the media/ directory.
Seems weird that only relative paths are allowed when backing up from the main server account given that there are likely several domains, some of which might have similar paths that need to be excluded on some domains, but not others.
Marco,
I you'd like to exclude all files from all cahce dirrectories, you can use the following regexp:
CONFIG_TEXT: **/cache/**
and here is come technical exaplanation:
*
in the end of string transforms into.*
*
in all other places transforms into[^/]*
**
in all places transforms into.*
@Michael, currently it is not possible, unfortunately.
From full server backup I want to skip a entire subdomain's folder.
I tried to use /var/www/vhosts/example.com/subdomain.example.com* but doesn't work for me.
What's the right way?
Like Lrnt and Michael M. Im looking for a possibility to exclude whole domains from backup.
There is a Vote going on, to implement that Feature: https://plesk.uservoice.com/forums/184549-feature-suggestions/suggestions/35420890-exclude-domains-from-backup-in-ui
is there a way to exclude specific domains from the backup when you use the server wide backup in GUI?
@Wiebe de Wolf,
Such functionality hasn't been implemented yet, but we do have a feature request on it.
Feel free to vote it up if you find it useful.
I also recommend sharing you thoughts in comments of feature request so we can better understand why this one is important.
Hello @Marek,
Please, let me know the Plesk version and OS you use.
Hello,
can u please tell how to exclude specific database dump files from backup?
Thanks!
So what about help from support?
So, please correct the description of option "Exclude specific files from the backup" in Plesk UI because it says to use the leading slash:
"You can only exclude files within webspaces. Specify the path or paths relative to the webspace root, separating individual files with commas. Using the mask symbol is allowed (e.g. /somedir/log*)."
@Anton Maslov,
Thanks!
Is it in plans?
Pera,
To exclude all subfolders with names starting with "sub" from folder 1, the following line can be used:
/httpdocs/folder1/sub*
how to exclude folder from backup and all sub-folders
I want to exclude "/domain.tld/httpdocs/folder1/sub1/sub2/sub3/sub4/sub5"
how can I exclude all 5 subfolders without writing 5 different rules?
it is especially important, because folders are dynamically created with random names, so it is impossible to think ahead
Topic has been updated... "Note: when excluding specific files from Full Server backup all files specified in Exclude specific files from the backup option on all domains will be excluded. It is not possible exclude specific file from specific domain only. Vote to implement features on Plesk User Voice Portal." :-(
Hi. I have Onyx 17.8.11, CentOS 7
I hope you notice my sad emoji at the end. I feel the same as you: in 2021, not being able to resolve this issue is very sad.
So can not understand, please help. How to exclude:
/var/www/vhosts/domain1.com/folder/folder2/* - only files in folder2 tha in subfolder folder on domain2.com
/var/www/vhosts/domain1.com/folder2/* - only files in folder2 on domain1.com
/var/www/vhosts/domain2.com/folder2/* - only files in folder2 on domain2.com
/var/www/vhosts/domain3/* - completely
All these rules must work at one schudeled backup task
Suggestion! - If you popped open an interface like in the "file manager" (123.123.123.123:8443/smb/file-manager/list). It would be much easier for us to check files or directories we want to include or exclude in the backup. just a thought.
Hi,
how can I handle to exclude a complete data directory with subfolders and files?
Example:
Data\1\diff. Folders
Data\2\diff. Folders and Files
Data\3\...
So exclude the complete "data" folder with all sub directories and files - that is my question.
Thx
@Mihael, no such plans at the moment, you may post the suggestion here to consider it in future versions.
Hi! How should I exclude files according to their extension?
1)
*.tar,*.tar.gz,*.zip,*.gz,*.gzip
2)
*.tar
*.tar.gz
*.zip
*.gz
*.gzip
Thanks!
Hi James001 Please take a look at the following article in order to by pass this issue: https://support.plesk.com/hc/en-us/articles/360005893894
Fabian Lindner Already voted for this months ago ;)
Hi, I can not see "Exclude specific files from the backup" option.
What can be the reason?
Hello @Pera Burek,
/var/www/vhosts/mydomain.com/httpdocs/ should be skipped as this option uses relative path inside default document root directory. In your case the path should be set to /images/exclude-this-folder/*
or
Too, the trailing wildcard is mandatory?
Please sign in to leave a comment.