Solved

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

Posted on 2013-06-25
6
1,533 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
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 
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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

Let's say you need to move the data of a file system from one partition to another. This generally involves dismounting the file system, backing it up to tapes, and restoring it to a new partition. You may also copy the file system from one place to…
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…
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.

773 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