How to exclude specific files/directories from a backup in Plesk?

Follow

Comments

39 comments

  • Avatar
    Lrnt L (Edited )

    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.

    2
    Comment actions Permalink
  • Avatar
    Lrnt L

    +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

    1
    Comment actions Permalink
  • Avatar
    cuong nguyen

    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?

    1
    Comment actions Permalink
  • Avatar
    Phil Glau

    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.

    1
    Comment actions Permalink
  • Avatar
    Konstantin Annikov (Edited )

    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 .*

    0
    Comment actions Permalink
  • Avatar
    Anton Maslov

    @Michael, currently it is not possible, unfortunately. 

    0
    Comment actions Permalink
  • Avatar
    Elia Marsura

    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? 

    0
    Comment actions Permalink
  • Avatar
    Fabian Lindner

    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

    0
    Comment actions Permalink
  • Avatar
    Wiebe de Wolf

    is there a way to exclude specific domains from the backup when you use the server wide backup in GUI?

    0
    Comment actions Permalink
  • Avatar
    Anzhelika Khapaknysh

    @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. 

    0
    Comment actions Permalink
  • Avatar
    Ivan Postnikov

    Hello @Marek,

    Please, let me know the Plesk version and OS you use.

    0
    Comment actions Permalink
  • Avatar
    Michael M.

    Hello,

     

    can u please tell how to exclude specific database dump files from backup?

     

    Thanks!

    0
    Comment actions Permalink
  • Avatar
    Michael M.

    So what about help from support?

    0
    Comment actions Permalink
  • Avatar
    Marco Marsala

    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*)."

    0
    Comment actions Permalink
  • Avatar
    Michael M.

    @Anton Maslov,

    Thanks!

    Is it in plans?

     

    0
    Comment actions Permalink
  • Avatar
    Alexander Tsmokalyuk

    Pera,

    To exclude all subfolders with names starting with "sub" from folder 1, the following line can be used:

    /httpdocs/folder1/sub*

     

     

    0
    Comment actions Permalink
  • Avatar
    Peter Burek

    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

    0
    Comment actions Permalink
  • Avatar
    Lrnt L

    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." :-(

    0
    Comment actions Permalink
  • Avatar
    Marek Kaczanowicz

    Hi. I have Onyx 17.8.11, CentOS 7

    0
    Comment actions Permalink
  • Avatar
    Lrnt L

    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.

    0
    Comment actions Permalink
  • Avatar
    Michael M.

    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

    0
    Comment actions Permalink
  • Avatar
    Ari Benami

    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.

    0
    Comment actions Permalink
  • Avatar
    Michael W

    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

    0
    Comment actions Permalink
  • Avatar
    Anton Maslov

    @Mihael, no such plans at the moment, you may post the suggestion here to consider it in future versions.

    0
    Comment actions Permalink
  • Avatar
    Santiago Botto

    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!

    0
    Comment actions Permalink
  • Avatar
    Julian Bonpland Mignaquy

    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

    0
    Comment actions Permalink
  • Avatar
    Lrnt L

    Fabian Lindner Already voted for this months ago ;)

    0
    Comment actions Permalink
  • Avatar
    Marek Kaczanowicz

    Hi, I can not see "Exclude specific files from the backup" option.

    What can be the reason?

    0
    Comment actions Permalink
  • Avatar
    Lev Iurev

    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/*

    0
    Comment actions Permalink
  • Avatar
    Marco Marsala (Edited )
    httpdocs/images/*

    or

    /httpdocs/images/*?

    Too, the trailing wildcard is mandatory?

    0
    Comment actions Permalink

Please sign in to leave a comment.

Have more questions? Submit a request