Solved

tar command

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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Problem Imaging Computers With Clonezilla 2 70
Solaris OS patch 3 28
ftpcommand 2 50
auto mounter on solaris 1 39
When you do backups in the Solaris Operating System, the file system must be inactive. Otherwise, the output may be inconsistent. A file system is inactive when it's unmounted or it's write-locked by the operating system. Although the fssnap utility…
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 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.:
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

708 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

16 Experts available now in Live!

Get 1:1 Help Now