I am having problems with the exclude (-X) option when using tar. I am trying to specifically exclude the RCS subdirectories (something similar to the -F option for non-gnu tar).
Simple example: I have a dir called px/, which has a subdir called 2005/. I want to create a tarball of all the files in the 2005/ folder *except* for the RCS/ directory. 1st try: $tar -cf - 2005/ | gzip > px2005.bkup.1023.tar.gz # No good, RCS dirs get needlessly backed up as well 2nd try $tar -cf - 2005/ -X 2005/RCS | gzip > px2005.bkup.1023.tar.gz $tar -cf - 2005/ -X 2005/RCS/ | gzip > px2005.bkup.1023.tar.gz # No good, both options give the same error: tar: 2005/RCS/: Is a directory tar: Error is not recoverable: exiting now 3rd try $tar -cf - 2005/ -X 2005/RCS/* | gzip > px2005.bkup.1023.tar.gz # No good,makes the tar.gz, but the file is mangled 4th try, just make the tar file and just choose one file to exclude $tar -cf px2005.bkup.1023.tar 2005/ -X 2005/RCS/constants.php,v # No good, tar file created but on extraction, constants.php,v is present 5th try, try a file w/o a comma, just for giggles $tar -cf px2005.bkup.1023.tar 2005/ -X 2005/index.php # No good, tar file created, but on extraction, index.php is present Any hints and suggestions appreciated. Dash in the wrong place, order of options presented wrong? Correct the error of my ways, please! $tar -cf - 2005/ -X 2005/RCS | gzip > px2005.bkup.1013.tar.gz _______________________________________________ help-gnu-utils mailing list help-gnu-utils@gnu.org http://lists.gnu.org/mailman/listinfo/help-gnu-utils