I have a folder which includes subfolders which in turn have subfolders as well. I tried:
tar --exclude='*.msh' --exclude='*.geo' -czvf cont.gz run-1/*
to compress all files and subfolders in run-1 but the files with msh and geo extensions. But tar keeps adding those files still. The files which meant to be excluded are not in run-1 but in one of the subfolders of it and I don't want to specify the locations explicitly. Where is the problem?
Edit: Below is one of the subfolders under run-1. Other subfolders have similar structure. I am also ok with excluding msh folder in all subfolders as well.
run-1
|-np-8
|-nmesh-3
|-ncell-1
|-bunch of files
|-msh
|-bg.msh
|-bg.geo