Tar command | Unix Linux Forums | UNIX for Advanced & Expert Users

  Go Back    


UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD.

Tar command

UNIX for Advanced & Expert Users


Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 06-29-2006
satimis satimis is offline
Registered User
 
Join Date: Jun 2006
Last Activity: 28 January 2013, 8:25 AM EST
Posts: 70
Thanks: 0
Thanked 0 Times in 0 Posts
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
Sponsored Links
    #2  
Old 06-29-2006
prashant_kr2002 prashant_kr2002 is offline
Registered User
 
Join Date: Jun 2006
Last Activity: 2 August 2006, 12:33 PM EDT
Location: New Delhi
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
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
Sponsored Links
    #3  
Old 06-29-2006
satimis satimis is offline
Registered User
 
Join Date: Jun 2006
Last Activity: 28 January 2013, 8:25 AM EST
Posts: 70
Thanks: 0
Thanked 0 Times in 0 Posts
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
    #4  
Old 06-29-2006
prashant_kr2002 prashant_kr2002 is offline
Registered User
 
Join Date: Jun 2006
Last Activity: 2 August 2006, 12:33 PM EDT
Location: New Delhi
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
MySQL

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

Prashant.
Sponsored Links
    #5  
Old 06-29-2006
satimis satimis is offline
Registered User
 
Join Date: Jun 2006
Last Activity: 28 January 2013, 8:25 AM EST
Posts: 70
Thanks: 0
Thanked 0 Times in 0 Posts
Hi prashant_kr2002,

Quote:
you can use the -u option which will update the existing archive and add new contents to it if doesn't exists.
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
Code:
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
Code:
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
Sponsored Links
    #6  
Old 07-01-2006
prashant_kr2002 prashant_kr2002 is offline
Registered User
 
Join Date: Jun 2006
Last Activity: 2 August 2006, 12:33 PM EDT
Location: New Delhi
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
MySQL

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 :-)

Prashant.
Sponsored Links
    #7  
Old 07-01-2006
xinusys xinusys is offline
Registered User
 
Join Date: May 2006
Last Activity: 28 March 2008, 7:19 AM EDT
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Bug Use bunzip2

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

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
passing command output from one command to the next command in cshell kaaliakahn UNIX for Dummies Questions & Answers 2 02-10-2012 04:59 PM
unix command : how to insert text at the cursor location via command line? xib.be UNIX for Advanced & Expert Users 0 12-22-2010 05:45 PM
Need help! command working ok when executed in command line, but fails when run inside a script! 4dirk1 Shell Programming and Scripting 4 12-02-2010 05:47 AM
awk command in script gives error while same awk command at prompt runs fine: Why? catalys Shell Programming and Scripting 4 09-20-2010 10:07 PM
awk/sed Command : Parse parameter file / send the lines to the ksh export command rajan_san Shell Programming and Scripting 4 11-06-2008 12:29 PM



All times are GMT -4. The time now is 02:57 PM.