Solved

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

Posted on 2013-06-25
6
1,504 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

In tuning file systems on the Solaris Operating System, changing some parameters of a file system usually destroys the data on it. For instance, changing the cache segment block size in the volume of a T3 requires that you delete the existing volu…
Every server (virtual or physical) needs a console: and the console can be provided through hardware directly connected, software for remote connections, local connections, through a KVM, etc. This document explains the different types of consol…
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…

863 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

Need Help in Real-Time?

Connect with top rated Experts

26 Experts available now in Live!

Get 1:1 Help Now