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

Follow

Comments

12 comments

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

    or

    /httpdocs/images/*?

    Too, the trailing wildcard is mandatory?

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

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

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

  • Avatar
    Marco Marsala

    Will

    */cache/*

    exclude files and folders in

    /httpdocs/wp-content/cache/*

    ?

    Sorry but I'm doubt about the syntax.

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

  • 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

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

     

     

  • Avatar
    Marek Kaczanowicz

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

    What can be the reason?

  • Avatar
    Ivan Postnikov

    Hello @Marek,

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

  • Avatar
    Marek Kaczanowicz

    Hi. I have Onyx 17.8.11, CentOS 7

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

Please sign in to leave a comment.

Have more questions? Submit a request