On 2011-05-31, Marian Hettwer <m...@kernel32.de> wrote: > On Tue, 31 May 2011 10:53:58 +0200, LEVAI Daniel <l...@ecentrum.hu> > wrote: >> On Tue, May 31, 2011 at 11:42:24 +0300, Michael Sioutis wrote: >>> Hello! >>> >>> I can't find it in the man page, and it seems it is not supported (?) >>> I am trying to backup some folders and want to exclude some and nth >>> will work. I've tried: >>> --exclude=/folder/ >>> --exclude="/folder/ >>> --exclude /folder >>> --exclude "folder" >>> >>> I will get an error: "--exclude... directory doesn't exist". >>> >>> Excluding will work in Linux. >>> >> That is a GNU extension. You can work this around with find(1) and the >> tar(1)'s '-I' option. >> >> > > bsdtar from the FreeBSD project supports --exclude too. > The OP could as well install gnu tar from packages. bsdtar doens't seem > to exist... > > At least that's what I do at work (Debian, Solaris, OpenBSD env). > It's a pain to walk around every nifty details of different unixes...
The other way you can do it is just use posix-specified options and not rely on vendor-specific extensions. But unfortunately many of the vendors (*cough*gnu*cough*) don't make it clear which options are standard and which are extensions... And, sadly, even some of the BSD-derived OS have replaced a bunch of their standard tools with GNU.