Solved

AIX - Archiving (tar) a filesystems and excluding a directory

Posted on 2013-05-13
4
695 Views
Last Modified: 2013-05-14
Please help with tar command. See below.

Trying to archive /business/obj/11.2 and trying to exclude /business/obj/11.2/data

Here is what I tried:

tar -cvf /business/obj/11.2.tar -X /business/obj/11.2/data /business/obj/11.2

and here is my ouput, which is not working:

a /business/obj/11.2 (excluded)
0
Comment
Question by:AIX25
  • 2
  • 2
4 Comments
 
LVL 68

Accepted Solution

by:
woolmilkporc earned 500 total points
ID: 39162331
Hi,

if it's AIX tar then -X expects a file containing names of directories to be excluded, and not a direct value.

So create a file, let's say "/tmp/tar_excl" containing just the string

/business/obj/11.2/data

an rerun your command like this:

tar -cv -X /tmp/tar_excl  -f /business/obj/11.2.tar  /business/obj/11.2
or
tar -cvf /business/obj/11.2.tar -X /tmp/tar_excl  /business/obj/11.2

I assume you're aware that the name of your archive will be "11.2.tar" and that it will be located under the directory structure "/business/obj/"
0
 

Author Comment

by:AIX25
ID: 39162613
You method worked only to a point....it skipped /data, but it did not finish tar'ing up the directory.

I received this error:

tar: 0511-194 Reached end-of-file before expected.

Please advise
0
 

Author Comment

by:AIX25
ID: 39162623
Also, my ulimits are set to unlimited.
0
 
LVL 68

Assisted Solution

by:woolmilkporc
woolmilkporc earned 500 total points
ID: 39162676
Those errors are almost always related to space limitations, be it by ulimit, quota or filesystem size, or (sometimes) they're related to filesystem defects.

To rule this out nevertheless (to check if it's a read or logic issue) you could redirect the output to /dev/null :

tar -cvf  -  -X /tmp/tar_excl  /business/obj/11.2 >/dev/null

Note the "-" (minus) sign following "-f "!

You will see the verbose log anyway, because it goes to stderr.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

A metadevice consists of one or more devices (slices). It can be expanded by adding slices. Then, it can be grown to fill a larger space while the file system is in use. However, not all UNIX file systems (UFS) can be expanded this way. The conca…
Using libpcap/Jpcap to capture and send packets on Solaris version (10/11) Library used: 1.      Libpcap (http://www.tcpdump.org) Version 1.2 2.      Jpcap(http://netresearch.ics.uci.edu/kfujii/Jpcap/doc/index.html) Version 0.6 Prerequisite: 1.      GCC …
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.:
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.

760 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

23 Experts available now in Live!

Get 1:1 Help Now