Solved

# tar -cpvzf /home/oracle/db112.tgz . tar: illegal option -- z

Posted on 2013-06-25
6
1,590 Views
Last Modified: 2013-06-26
Hi experts.

Aix 6.1 - as root I can't do this, any ideas?

# tar -cpvzf /home/oracle/db112.tgz .
tar: illegal option -- z
0
Comment
Question by:LindaC
6 Comments
 
LVL 9

Expert Comment

by:gt2847c
ID: 39276057
Looks like the built in AIX tar doesn't support the compression option.  You may have to go find a copy of GNU Tar or gzip the tar file.
0
 
LVL 8

Author Comment

by:LindaC
ID: 39276064
So how to execute is as tar -cvf <name>.tar?

What is the p for
What is the z for?
0
 
LVL 68

Accepted Solution

by:
woolmilkporc earned 475 total points
ID: 39276070
Hi,

sad to say, but AIX' tar does not support the "-z" (=compress) option.

You could create your tar archive without this option and compress it afterwards, like

# tar -cpvf /home/oracle/db112.tar .
# compress /home/oracle/db112.tar

This will result in a compressed file /home/oracle/db112.tar.Z

AIX does not have gzip, so you must use "compress".

By the way, "-p" means "preserve permissions".

Alternatively, if you have root access and are allowed to install open source software you could get yourself GNU tar (which supports "-z") and install it.

It's here:

http://www.perzl.org/aix/index.php?n=Main.Tar

"gettext" is a prerequisite which you must install beforehand:

http://www.perzl.org/aix/index.php?n=Main.Gettext

Sorry, no better news!

wmp
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 9

Assisted Solution

by:gt2847c
gt2847c earned 25 total points
ID: 39276092
-p preserves permissions on the file, but that's on the extract
-z (in those versions of tar that support it) is use gzip compression

a .tgz file is a gzipped tar file (by convention)

so:

-c = create
-v = verbose
-f = specify output or input filename depending on operation

tar -cvf filename.tar /directory/

Will create a a filename.tar file from whatever is in /directory/
0
 
LVL 8

Author Closing Comment

by:LindaC
ID: 39276128
Thank you!
0
 
LVL 48

Expert Comment

by:Tintin
ID: 39277249
You can do the equivalent of:

tar -cpvzf /home/oracle/db112.tgz .

with

tar -cpvf - . | gzip -c >/home/oracle/db112.tgz
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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

Title # Comments Views Activity
OpenLDAP Proxy to Active Directy 6 453
dot directory in FreeBSD??? 4 90
How to Insert a File Using Text Editor 9 100
Retreiving column names in Windows but not in Unix 11 75
Attention: This article will no longer be maintained. If you have any questions, please feel free to mail me. jgh@FreeBSD.org Please see http://www.freebsd.org/doc/en_US.ISO8859-1/articles/freebsd-update-server/ for the updated article. It is avail…
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 how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

740 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