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




  • Avatar
    Marco Marsala (Edited )



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



    exclude files and folders in



    Sorry but I'm doubt about the syntax.

  • Avatar
    Konstantin Annikov (Edited )


    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


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




  • 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


    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.

  • Avatar
    Michael W



    how can I handle to exclude a complete data directory with subfolders and files?




    Data\1\diff. Folders

    Data\2\diff. Folders and Files



    So exclude the complete "data" folder with all sub directories and files - that is my question.


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

  • 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

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

  • Avatar
    Lev Iurev

    Hello @Pera Burek,

    /var/www/vhosts/  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/*

Please sign in to leave a comment.

Have more questions? Submit a request