I am looking for a tar command that meets the following requirements:
I want to exclude all files ending with: backwpup & .zip (in between and before can be any e.g. uploads/123backwpup-123.zip) I want to exclude all folders in the area /media/backup/ & /application/cache/
I start at a level that looks like this:
- example.com
- example.de
- example.org
With subdirectories for each:
- /etc/
- /httpdocs/
- /lib/
- ...
Only the content of /httpdocs/ needs to be saved.
I tried it with command:
tar --exclude={"*backwpup*.zip", "*/media/backup/*", "*/application/cache/*"} -czvf backup.tar.gz **/httpdocs
But unfortunately backups with path wp-content/uploads/backwpup-4578-backups/2022-10-31_12-22-31_IKXUCSLD01.zip are still included.