?
Solved

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

Posted on 2013-05-13
4
Medium Priority
?
730 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 2000 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 2000 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

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…
Introduction Regular patching is part of a system administrator's tasks. However, many patches require that the system be in single-user mode before they can be installed. A cluster patch in particular can take quite a while to apply if the machine…
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…
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.
Suggested Courses

777 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