Solved

Syntax for gtar

Posted on 2006-06-09
6
1,815 Views
Last Modified: 2008-01-09
Trying to gtar directory and subdirectories.  Need to include long file names and maintain symbolic links and maintain permissions.  What is the syntax for command line?

0
Comment
Question by:xoxomos
6 Comments
 
LVL 45

Expert Comment

by:Kent Olsen
ID: 16870455
Hi xoxomos,

tar -cp {path} > archive

I think that gtar handles long file names automatically.
The default is to dump symlinks as symlinks.


Good Luck!
Kent
0
 
LVL 62

Accepted Solution

by:
gheist earned 150 total points
ID: 16875726
tar cpf file.tar directory/

cpf - create archive, include permissions, use first parameter as result file, instead of using default tape

ans xpf prameter after to extract using permissions.
0
 
LVL 6

Assisted Solution

by:JJSmith
JJSmith earned 100 total points
ID: 16881975
0
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 62

Expert Comment

by:gheist
ID: 16882023
http://www.freebsd.org/cgi/man.cgi?query=tar

Basically for extra info on what parameters to avoid to keep scrits portabls...
0
 

Author Comment

by:xoxomos
ID: 16887482
Actually is Solaris and it doesn't seem to like tar -cp {path} > archive
0
 
LVL 62

Expert Comment

by:gheist
ID: 16889781
Not that way.

tar cpf - {path} > archive

i.e. one should use stdout instead of default tape for shell redirect to work.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction Regular patching is part of a system administrator's tasks. However, many patches require that the system be in single-user mode before they can be installed. A cluster patch in particular can take quite a while to apply if the machine…
Why Shell Scripting? Shell scripting is a powerful method of accessing UNIX systems and it is very flexible. Shell scripts are required when we want to execute a sequence of commands in Unix flavored operating systems. “Shell” is the command line i…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question