Open atrandafir opened 1 year ago
Update: I have found a workaround..
<source type="tar">
<option name="path" value="../crm"/>
<option name="exclude" value="crm/assets,crm/img,crm/uploads/propertyExporter,crm/uploads/resize,crm/uploads/properties,crm/protected/runtime,crm/protected/private/mails,crm/protected/private/attachments,crm/protected/private/uploads"/>
</source>
With the syntax above it looks like, at least in this case, we can get the expected result.
After checking the tar command phpbu
generates, we can see that it uses the -C
argument to move to a specific working directory, and from there, it specifies the directory crm
to be included in the backup:
-C '/var/www/vhosts/oibarcelona.com/phpbu/..' 'crm'
That means that the working directory is, one directory above of the specified source directory. So you can specify <source_dir>/exclude_path
, as in this case crm/assets
.
It is not the perfect solution but it works, while I won't have any subdirectory named crm/assets
that I want to include in the backup that could get excluded by mistake.
Also if anyone needs to test, you can use these arguments when running the command:
--debug --verbose --simulate
First of all thanks for creating this awesome tool for handling backups! :-)
Now back to the issue:
I am trying to make a tar backup and specify the paths to exclude.
The problem is I do not know how to make it exclude those paths just from the root of the source directory, not if a directory with same name is found in a subdirectory of the source.
I have tried:
Produces:
But if I untar the file and check with "git status", I can see the backup also excluded paths like these, that should not have been excluded:
Also tried:
Produces:
And doesn't exclude a thing.
I think I also tried with adding dot and shash, example:
./assets
and it still did not work.Before using
phpbu
I had this bash script: