?
Solved

tar command

Posted on 2004-04-19
4
Medium Priority
?
1,745 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 300 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

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…
Why Shell Scripting? Shell scripting is a powerful method of accessing UNIX systems and it is very flexible. Shell scripts are required when we want to execute a sequence of commands in Unix flavored operating systems. “Shell” is the command line i…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
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

718 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