tar -cvf file.tar --exclude=thumbs/ \
--exclude=uploads_event/ \
--exclude=uploads_forum/ \
--exclude=uploads_admin/ \
--exclude=uploads_userpoints/ \
--exclude=uploads_group/ \
--exclude=up_old/ \
--exclude=uploads_user/ \
--exclude=uploads_wall/ \
directory_to_tar/
Do I have it wrong? Trying to tar entire directory but exclude all those directories and any files in those folders completely.
With GNU tar you can't include the trailing slash on all those excludes. It'd work with BSD tar, though.
Michael Lowman's answer should be accepted, but since I made up some examples anyway I'm going to generalize it and leave it, maybe someone will find value in it.
To repeat Michael's answer, it appears that the trailing slashes on your
--exclude
options are your problem.I'll also note that when you have a ton of stuff to exclude, it can be easier to put it in a file and just include the file with the -X option.
Here are a couple of practical examples of using --exclude and -X