I want to exclude two files from a tar file.. But it doesn't seem to work
cd /var/www/public/api_test
tar -zcvf api_v2.x.tar.gz api --exclude "./api/distributor_test.php" --exclude "./api/library/Distributor_API.php"
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.
Sign up to join this communitytry (in one line, I fold for readability)
tar -zcvf api_v2.x.tar.gz
--exclude api/distributor_test.php
--exclude api/library/Distributor_API.php api
api
) should be put last
tar -zcvf api_v2.x.tar.gz --exclude api/distributor_test.php --exclude api/library/Distributor_API.php api
? – Archemar Sep 4 '15 at 9:45