Solved

tar command

Posted on 2004-04-19
4
1,743 Views
Last Modified: 2013-12-27
Hi All,

Our system is AIX 5.1.

1. I wrote a srcipt to tar FOUR directories:
 
tar -cvf /dev/rmt0.1 / >> /logs/coldbackup
tar -cvf /dev/rmt0.1 /usr >> /logs/coldbackup
tar -cvf /dev/rmt0.1 /var>> /logs/coldbackup
tar -cvf /dev/rmt0.1 /opt >> /logs/coldbackup

However at the end I found it tar ALL the directories in my system, such as /tmp, /abc, /def, ....etc. So what's the problem? I shouldn't put tar / (root) in the script? if there is alternative method to backup / ?

2. I saw there is some limitation on using tar to backup the file size which is bigger than 2 G, so how to solve?

Thanks
0
Comment
Question by:terrywong
[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
4 Comments
 
LVL 12

Expert Comment

by:stefan73
ID: 10857996
Hi terrywong,
> I shouldn't put tar / (root) in the script? if there is alternative
> method to backup / ?

Depends. Some tars, such as Gnu tar, allow you to specify not to cross a file system's boundary.
In terms of performance, it's probably better to back up all file systems in parallel, but you'd need several tape drives for that.

> I saw there is some limitation on using tar to backup the file size which is bigger than 2 G, so how to solve?

Again, depends :-)
There are tar versions which support 64bit file sizes. You can simply check yours by creating a dummy file, like

dd if=/dev/zero bs=1024k count=2500 > some_place_which_supports_big_files

...and tar it.

(maybe dd also doesn't like 2G files - check your documentation)



Cheers,
Stefan
0
 
LVL 12

Expert Comment

by:stefan73
ID: 10857998
terrywong,
I strongly suggest to use gtar. Check http://www.gnu.org on how to get it for AIX.

Stefan
0
 
LVL 48

Expert Comment

by:Tintin
ID: 10865477
You are better off using the AIX backup command instead of tar for system backups.

BTW, why are you asking an AIX question in the Solaris area?  Did you know there is a new "AIX ISMs UNIX OS" area?
0
 

Accepted Solution

by:
RayZilla earned 100 total points
ID: 11175024
tar -cvf /dev/rmt0.1 / >> /logs/coldbackup
this will backup anything in and below root i.e you're whole filesystem.

Proposed Solution :

In Solaris 8 there is the X switch   (tar -cvfX   ) it allows you to
use an Exclude file in side of which you can place
excluded files and directories

SYNOPSIS
     tar c  [  bBeEfFhiklnopPqvwX  [ 0-7 ]  ]  [ block ]  [  tar-
     file  ]   [ exclude-file ]  { -I include-file | -C directory
     | file  | file }

Don't know if that exists in AIX


example :  Text inside a file named  Exclude or any name you give it.

/tmp                             will exclude eveything in tmp and below for example
/etc                              next line ,  something else to exclude
/bogus/sample_file        Exclude a particular file within the bogus directory


Hope this helps

RayZilla
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

My previous tech tip, Installing the Solaris OS From the Flash Archive On a Tape (http://www.experts-exchange.com/articles/OS/Unix/Solaris/Installing-the-Solaris-OS-From-the-Flash-Archive-on-a-Tape.html), discussed installing the Solaris Operating S…
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 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

710 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