[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

tar bug?



I haven't used tar that much so I don't know if this is the way it has always been or if this is a bug.

Tar automatically excludes the archive being created from archive in order to prevent an infinite loop.
$ tar -cvvf /home/colin/tartest/test/tartest.tar /home/colin/tartest/*

tar: Removing leading `/' from member names
-rw-r--r-- colin/colin      20 2005-08-09 09:20:34 /home/colin/tartest/file
drwxr-xr-x colin/colin       0 2005-08-09 09:35:41 /home/colin/tartest/test/
tar: /home/colin/tartest/test/tartest.tar: file is the archive; not dumped

but if you use compression it will include the file

$ tar -cjvvf /home/colin/tartest/test/tartest.tar /home/colin/tartest/*
tar: Removing leading `/' from member names
-rw-r--r-- colin/colin      20 2005-08-09 09:20:34 /home/colin/tartest/file
drwxr-xr-x colin/colin       0 2005-08-09 09:37:26 /home/colin/tartest/test/
-rw-r--r-- colin/colin 0 2005-08-09 09:37:26 /home/colin/tartest/test/tartest.tar

$ tar -czvvf /home/colin/tartest/test/tartest.tar /home/colin/tartest/*
tar: Removing leading `/' from member names
-rw-r--r-- colin/colin      20 2005-08-09 09:20:34 /home/colin/tartest/file
drwxr-xr-x colin/colin       0 2005-08-09 09:38:13 /home/colin/tartest/test/
-rw-r--r-- colin/colin 0 2005-08-09 09:38:13 /home/colin/tartest/test/tartest.tar

You must manually exclude the file to get around the problem.

Is this the normal behavior of tar?????



Reply to: