AIX 4.2: tar using compression ?

Hi, is there a way to use compression on the TAR command running on a AIX 4.2 ?

I did a "man tar" but did not see mentions of using compression, nor how to even find out the tar version.

I want to look into ways of reducing the amount of time to do backups. One backup is dumping database backups on tapes using TAR but just one single TAR can take up to 4 hours to do. The other means of backups we have are mksysb.

tar on AIX does not have a compression switch. tar it first, then try running compress or whatever is available. Suffix for tar+compress should look like "filename.tar.Z".

We tar directly to tapes.

Some of our backups don't have enough space to have twice the amount of space as 2 backups. I found that out when I tried to copy the backup folder to something else as I wanted to test the efficiency of the compress command on that copied backup folder.

Is it all tar versions on AIX that don't have the compression option ?

Since tar is an independant program, I thought at worst we could somehow get the latest version to run on our AIX 4.2

The latest tar I have access to is on AIX 5.3 and it has no -z. Also it is possible to just install Gnu tar from the Linux toolbox since AIX 4.3.3. No idea if this exists for 4.2.

Also you can tar it 1st, compress it and then write it with tar again to tape. Maybe there also some methods with cpio etc.

try sth like:
# tar -cvf - $(yourfilelist) | gzip > file.tar.gz

... unix commands are small compared to windoze... but you can combine them into powerful tools :wink:

Then I guess for the moment, I will have to investigate how to get enough free space somewhere to compress the backup files on disk and then dump them to tape with TAR.

Thx for the answers.

I did a test.

I went into one of the backup folders I did last sunday. I picked one backup file and did a 'compress' on it :

Before : filesize = 1,943,830,528
After : filesize = 267,629,228

Compression ratio of 'compress' command = 86.23%
Time of 'compress' command completion = 25min

Since this particular server has about 7 files totalizing roughly 10.5Gb, it would take 02:12 to compress them all.

So if this particular server backup takes about 4 hours to backup everything non-compressed, it would take 2hrs (compression time) + 2hrs (50% normal backup time) = 4 hrs.

Hummm, I am not really saving anytime here. I do admit that using 50% of backup time when the compression ratio of one file was 86% is a bit exaggerating. I just used it as worst case scenario.

I know on one other servers where we don't do DB backups, we are using PKZIP v2.51 . I have no idea on how fast it would be using it compared to the 'compress' command and, I do not know if the license would allow it to use it on other servers.

Any comments ?

Why should you? :confused: Again we are talking Unix here. Use sth. like
# tar ... | dd of=/dev/rmt0 obs=20
It would be just a matter of combination to write directly onto a tape.
You might find the following information useful:
http://www.ahinc.com/aix/backup.htm

Thank you for the info.

1) Looking at the link you provided, I see something which puzzles me:

I don't understand this as we have one weekly backup done with TAR that spawns on 2 tapes !

So this makes me wonder about the truth of the following:

2) For our TARing to to 8mm 5Gb tapes, we use a blksize=10240. What would be the blksize used for DD and GZIP v1.2.4?

3) Humm, I see that now all our servers have GZIP installed. Is this 1.2.4 version a free one ?

It might be necessary to distinguish between programs that have the same name but originate from different sources. AIX tar is different from the Gnu tar (from the Linux Toolbox). AIX dd is different from the Gnu dd.... I think you got the message. So when you look for information that is specific you might look up the IBM Information Center for AIX programs and somewhere else for Gnu programs. Don't compare Linux to AIX. Many things are alike but when it comes to the details it is pretty different. AIX is not Linux.
Last thought: AIX dd supports spanning across several media since AIX 5L (span=yes) came to market in 2000 or 2001 ....