Solved

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

Posted on 2013-05-13
4
704 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

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

I have been running these systems for a few years now and I am just very happy with them.   I just wanted to share the manual that I have created for upgrades and other things.  Oooh yes! FreeBSD makes me happy (as a server), no maintenance and I al…
FreeBSD on EC2 FreeBSD (https://www.freebsd.org) is a robust Unix-like operating system that has been around for many years. FreeBSD is available on Amazon EC2 through Amazon Machine Images (AMIs) provided by FreeBSD developer and security office…
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.

867 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

21 Experts available now in Live!

Get 1:1 Help Now