I try to exclude every folder called 'logs' in my tar prompt (I don't need to backup all my log files)
Simplified my prompt looks like this:
tar -cvpf backup.tar servers --exclude='*/logs'
and my file-system like this:
/home/ backup.sh servers/ server1/ logs/ logfile1 logfile2 server2/ logs/ logfile1 logfile2 [server3 ... server100]/
If I run the script it does not exclude the log-folders whereas if I run the following it does:
tar -cvpf backup.tar servers --exclude=server1/logs --exclude=server2/logs (and so on for the rest of the servers)
So how can I change my command so that I don't have to copy-paste the exclude command for every server and most likely produce some mistakes?