so I created a tar.gz file under openwrt and amd having issues getting the syntax correct to extract the tar.gz file while excluding/not extracting certain files from the tar.gz. No matter how I format the syntax it either gives and error or extracts the contents I told it to exclude. Sometimes it will even say the specified file I am telling it to exclude (-X) is not inside the tar file when in fact it is. Can someone please clarify the correct syntax for tar to exclude files.
The below code extracts everything inside the archive and ignores my exclude parameter.
tar xzvf /root/compressedfiles.tar.gz -X /root/excludethisfile.sh -C /
Use the "t" option to see the contents of the file. However, "tar" tends to strip the first "/" when creating the file, you probably want to exclude "root/...".