Solved

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

Posted on 2013-05-13
4
720 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Independent Software Vendors: 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!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
reinstall 1 92
replace column/record content in a *csv file based on a regular expression 6 80
Best way to split and output to csv in bash 2 76
Solaris acount issues 44 48
Hello fellow BSD lovers, I've created a patch process for patching openjdk6 for BSD (FreeBSD specifically), although I tried to keep all BSD versions in mind when creating my patch. Welcome to OpenJDK6 on BSD First let me start with a little …
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 …
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.
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

726 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