Solved

tar command

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

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

Suggested Solutions

Installing FreeBSD… FreeBSD is a darling of an operating system. The stability and usability make it a clear choice for servers and desktops (for the cunning). Savvy?  The Ports collection makes available every popular FOSS application and packag…
Java performance on Solaris - Managing CPUs There are various resource controls in operating system which directly/indirectly influence the performance of application. one of the most important resource controls is "CPU".   In a multithreaded…
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…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:

911 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

22 Experts available now in Live!

Get 1:1 Help Now