• Please be aware: Kaspersky Anti-Virus has been deprecated
    With the upgrade to Plesk Obsidian 18.0.64, "Kaspersky Anti-Virus for Servers" will be automatically removed from the servers it is installed on. We recommend that you migrate to Sophos Anti-Virus for Servers.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Resolved Exclude a folder from backup?

Matt_Hill

New Pleskian
Is it possible to exclude an entire folder within the webspace from a backup?

I want to exclude the Magento cache folder, as with every backup i'm getting warnings stating certain files were not backed up as they do not exist anymore.

Edit - I solved the problem

All the cache files start with "mage" for the file name and have no file extension.

Setting the exclude option as: /httpdocs/mydomain.com/var/cache/mage* excluded the desired files.
 
Last edited:
Hi Matt_Hill,

you are able to exlude files with:

Separate the files with commas (",").
You can use the mask symbol ("*").
Example: /some/log*

Other examples:

*/cache/*
or
*/wp-content/cache/*
or
*/var/cache/*


or for example files with the ending *.log

*/*log

or for example files with the ending *.log AND *.bak

*/*log,*/*bak


"TEMP" or/and "TMP" - folders and its content should as well being excluded from backups.
 
I did /httpdocs/mydomain.com/var/cache/mage* as all the cache file names started with "mage", that has worked perfectly.

However am i correct in thinking /httpdocs/mydomain.com/var*/cache/* would exclude the entire cache folder? if so it would probably be better to simply exclude the cache folder i'm thinking.
 
However am i correct in thinking /httpdocs/mydomain.com/var*/cache/* would exclude the entire cache folder?
Correct... to be more specific to YOUR USED command: ALL files ( => "/*" ) at the subordinate structure of "/httpdocs/mydomain.com" with folders and starting names like "var" and containing folders with the name "/cache/" therein, will be excluded, when you use the exception: "/httpdocs/mydomain.com/var*/cache/*" . ;)
 
Unfortunatelly doesn't work for me!
I have scheduled a daily server backup from the Main backup settings but I can not exclude a specific folder I have try:
/var/www/vhosts/domain.com/httpdocs*/folder/*
/httpdocs/domain.com*/folder/*
Any suggestion?
 
Hi Manos_Gk,

/var/www/vhosts/domain.com/httpdocs*/folder/*
/httpdocs/domain.com*/folder/*
Wrong usage. Pls. consider to use for example:
Code:
/var/www/vhosts/YOUR-DOMAIN.COM/httpdocs/temp/*

When you use a placeholder "*" ( example: "httpdocs*/" , you want to exclude folders named as "httpdocsXXX" / httpdocsXXY / httpdocsXXZ , ... which doesn't include "httpdocs" itself. Pls. ONLY use FULL paths in your excludes. ;)
 
Hello,

/var/www/vhosts/YOUR-DOMAIN.COM/httpdocs/temp/*

was my first choice and doesn't work! The files are still on the backup!
 
There are examples given containing "/var/www/vhosts/YOUR-DOMAIN.COM"
On the page it says:

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

As I'm reading it, those examples containing "/var/www/vhosts" are false.
Am I correct?

This also means I can't put any domain-specific info there. So what I give there will always be applied to all domains. This isn't always wanted, however.

Wrong usage. Pls. consider to use for example:
Code:
/var/www/vhosts/YOUR-DOMAIN.COM/httpdocs/temp/*

When you use a placeholder "*" ( example: "httpdocs*/" , you want to exclude folders named as "httpdocsXXX" / httpdocsXXY / httpdocsXXZ , ... which doesn't include "httpdocs" itself. Pls. ONLY use FULL paths in your excludes. ;)
You're stating that /httpdocs*/ doesn't include /httpdocs/
This isn't the way it normally works.

The command:
Code:
ls /var/www/vhosts/*/logs/access_log*
includes access_log and all the other ones.
and
Code:
ls /var/www/vhosts/*/logs*/access_log
will show all the /logs/ folders

Wasn't it the "/var/www/vhosts/" that stopped it from working?

I just want to clear up some possible misunderstandings and reach a consensus.
 
Last edited:
Where are these settings located? Is this capability in Onyx 17.0.17?
Yes....

Strangely enough it's in the "Schedule Backup Setting" and not in the "Backup Settings"
If you select the checkbox "Exclude specific files from the backup" it will expand a text box where you can type the filters...

@UFHH01 no reaction?
 
I too am confused about how to implement this now...
I'm trying to exclude the possible paths for a Wordpress cache.

If we go by the "Specify the path or paths relative to the webspace root" instructions it gives, then this can't be correct, can it?
/var/www/vhosts/YOUR-DOMAIN.COM/httpdocs/wp-content/cache/*

So which of these is correct?

/httpdocs/wp-content/cache/*
or
httpdocs/wp-content/cache/*
or
/wp-content/cache/*
or
wp-content/cache/*

?
 
I think it's
Code:
/httpdocs/wp-content/cache/

I'm getting hits when I give the command
Code:
ls /var/www/vhosts/*/httpdocs/wp-content/cache/

I will include that entry (the first one) and will check the next full back-up, which will be some days from now.

I'm getting even more hits if I do
Code:
ls /var/www/vhosts/*/*/*/cache/*

So I'm going to use

Code:
/*/cache/*
/*/*/cache/*
/*/*/*/cache/*
/*/*/*/*/cache/*
/*/*/*/*/*/cache/*

I wonder if /cache/* would be enough. It isn't for ls
I also hope to keep the folder itself as it may not get automatically created by the website.

I was unable to find any thorough documentation from Plesk themselves on this subject.
The short explanation on the website isn't enough.
It's als hard to test as you don't want to do a 500 GB file transfer back and forth just for tests....
 
Last edited:
Hi @AlL,

I was unable to find any thorough documentation from Plesk themselves on this subject.
The short explanation on the website isn't enough.
It's als hard to test as you don't want to do a 500 GB file transfer back and forth just for tests....
I agree here: The documentation needs some improvement ( @IgorG , pls.! :D )

... but... because I like the Plesk Community, I just did some tests and can state now clearly with facts proof:

"/var/www/vhosts/YOUR-DOMAIN.COM" is the document - root for "YOUR-DOMAIN.COM" and therefore all exclusions have to be defined from here. ;)


Correct usage is ( as an example for wordpress - content, located at the MAIN - domain web - root ):
Code:
/httpdocs/wp-content/cache/*

or ( to cover as well subdomain - specific folders as for example "/SUBDOMAIN.YOUR-DOMAIN.COM/wp-content/cache" and other "normal" cache - locations, used by other CMS )
Code:
/*/cache/*
/*/*/cache/*

/*/tmp/*
/*/*/tmp/*

/*/temp/*
/*/*/temp/*
 
Last edited by a moderator:
@UFHH01 some questions:

1) if i implement an rule for exclude folder for backup over one folder it´s applied for all domains of the server?

2) can i exclude backups ouside of httpdocs but inside in /var/www/vhosts/mydomian.com/foldertoexclude/*
 
Hi solucionesuno,

to 1) Yes, this additional definition in your choosen schedule will apply for each included (sub)domain.

to 2) As stated above, the ROOT directory is "/var/www/vhosts/YOUR-DOMAIN.COM" and additional exclusions have to be setup as:

For ALL (sub)domains:
Code:
/*/cache/*

For the MAIN - DOMAIN:
Code:
/httpdocs/cache/*

For a specific SUB - Domain ( subdomain-name.YOUR-DOMAIN.com ):
Code:
/subdomain-name.YOUR-DOMAIN.com/cache/*
 
Back
Top