How to exclude specific files/directories or domains from a backup in GUI?

Follow

Comments

22 comments

  • Avatar
    Marco Marsala (Edited )
    httpdocs/images/*

    or

    /httpdocs/images/*?

    Too, the trailing wildcard is mandatory?

    0
    Comment actions Permalink
  • Avatar
    Andrey Ivanov

    Hello Marco,

    Please use relative paths only (means that values should not begin with "/"). As for asterisk symbol, it is mandatory if you want to exclude all files in a specific directory, otherwise, it will not work without *.

    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
    Nikolay Zhmuk (Edited )

    @Marco Marsala I double checked it on my test and it works in both ways: with leading slash and without it. Relative path should be specified inside webspace directory(e.g. /var/www/example.com/) For example, there is some subdirectory like /var/www/example/subdir/ and it is required to exclude the files inside of this subdirectory, the path you have to specify during backup creation is /subdir/* (or subdir/*) 

    The article has been update with additional details.

    0
    Comment actions Permalink
  • Avatar
    Marco Marsala

    Will

    */cache/*

    exclude files and folders in

    /httpdocs/wp-content/cache/*

    ?

    Sorry but I'm doubt about the syntax.

    0
    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
    Pera 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
    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
    Marek Kaczanowicz

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

    What can be the reason?

    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
    Marek Kaczanowicz

    Hi. I have Onyx 17.8.11, CentOS 7

    0
    Comment actions Permalink
  • Avatar
    Artyom Baranov

    @Marek,

    Hi! Please go to Tools & Settings > Backup Manager and press the "Back Up" button.

    There you may find Backup Settings and Exclude specific files from the backup option will be one of them.

    If you cannot see it there, please send me a screenshot of the page that appears after pressing the "Back Up" button.

    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
    Alexandr Redikultsev

    Hi @Michael W!

    You should use '*' symbol to do so.

    For example, in case Data folder is located in /httpdocs/test/, then use the following example to exclude Date and all its subfolders:

    /httpdocs/test/Data/*
    0
    Comment actions Permalink
  • Avatar
    Pera Burek (Edited )

    Plesk Onyx Version 17.8.11 Update #32
    running on Ubuntu 16.04.5 LTS

    Tools & Settings - > Backup Manager -> Back Up -> Exclude specific files from the backup

    how to type correct path

    what does this "Exclude specific files from the backup" consider as root ???

    "/var/www/vhosts/" or something else?

    when I add this
    /var/www/vhosts/mydomain.com/httpdocs/images/exclude-this-folder/*

    still all images in "exclude-this-folder" are INCLUDED in the backup

    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
    Michael S.

    Hello,

     

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

     

    Thanks!

    0
    Comment actions Permalink
  • Avatar
    Anton Maslov

    @Michael, currently it is not possible, unfortunately. 

    0
    Comment actions Permalink
  • Avatar
    Michael S.

    @Anton Maslov,

    Thanks!

    Is it in plans?

     

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

Please sign in to leave a comment.

Have more questions? Submit a request