Tar command

Hi folks,

Would the options p and --same-owner be the same effect?

On running;
1) tar jcpf AAA.tar.bz2 /path/to/AAA
and
2) tar jcpf AAA.tar.bz2 --same-owner /path/to/AAA

the results are more less the same. On 'man tar" I can't resolve. Please help. TIA

B.R.
satimis

the p switch stands for preserving the same permissions and timestamp of files and folders

-p
--same-permissions
--preserve-permissions Extract all protection information.
--preserve Has the effect of -p -s

--same-owner i was unable to find any where

use only p its sufficient.

Cheers !

Prashant

Hi prashant_kr2002,

Tks for your advice.

A further question if running;
# tar jpcf backup.tar.bz2 / --exclude=/proc --exclude=/sys --exclude=/home --exclude=backup.tar.bz2 etc.

to backup an OS and it stops in the middle for whatever reason. I wonder whether it can be resumed without starting over from the begining, similar to running "rtorrent" to download files.

TIA

B.R.
satimis

you can use the -u option which will update the existing archive and add new contents to it if doesn't exists.

Prashant.

Hi prashant_kr2002,

Tks for your advice. I made following test to update a compressed backup tarball;

# tar jcupf FC5_64_20060629.tar.bz2 / --exclude=/proc --exclude=/home --exclude=/media --exclude=/mnt --exclude=/sys --exclude=/tmp --exclude=lost+found --exclude=/FC5_64_20060629.tar.bz2

tar: You may not specify more than one `-Acdtrux' option
Try `tar --help' or `tar --usage' for more information.

# tar jupf FC5_64_20060629.tar.bz2 / --exclude=/proc --exclude=/home --exclude=/media --exclude=/mnt --exclude=/sys --exclude=/tmp --exclude=lost+found --exclude=/FC5_64_20060629.tar.bz2

tar: Cannot update compressed archives
Try `tar --help' or `tar --usage' for more information.

I can't resolve figuring out the correct syntax. Could you please shed me some light.

Besides how to read the the top level directories without decompressing the compressed tarball. The "t" option will read all files. TIA

B.R.
satimis

The u option can't be used simultaneously by c option once you have created the archive by c command used next time u option instead of c.

try now
tar jupf FC5_64_20060629.tar.bz2 / --exclude=/proc --exclude=/home --exclude=/media --exclude=/mnt --exclude=/sys --exclude=/tmp --exclude=lost+found --exclude=/FC5_64_20060629.tar.bz2

good luck :slight_smile:

Prashant.

hey folks use the utility bunzip2 on that perticular file.it will solve ur problem.

Hi prashant_kr2002,

Sorry still failed.

$ tar jupf FC5_64_20060629.tar.bz2...........

tar: Cannot update compressed archives
Try `tar --help' or `tar --usage' for more information.

B.R.
satimis

Hixinusys,

$ bunzip2 jupf FC5_64_20060629.tar.bz2 / ......

bunzip2: Can't open input file jupf: No such file or directory.
bunzip2: Input file / is a directory.

B.R.
satimis