Solved

tar command

Posted on 2004-04-19
4
1,741 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
  • 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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 …
This tech tip describes how to install the Solaris Operating System from a tape backup that was created using the Solaris flash archive utility. I have used this procedure on the Solaris 8 and 9 OS, and it shoudl also work well on the Solaris 10 rel…
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…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

839 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