The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM



View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #2 (permalink)  
Old 05-16-2006
azrealhk azrealhk is offline
Registered User
 

Join Date: Jul 2002
Location: HK
Posts: 20
You can probably chain a list of commands together.

If you know which files and directories to tar, it will be much easier.

On solaris
you can tar and compress using

cd /aaa/bbb; tar cvf - ./<ccc> | gzip - ccc.tar.gz

use -X to exclude directories, and -l for file list, whatever is more convenient for you.

on AIX replace gzip with compress (you will get a .Z file instead)

on AIX you only have -L to include the file list.

Obviously if you have a file list and know which directories to exclude you can type them in before hand and have a short one-liner.

Otherwise you may need a loop using ls and check for a directory and >> to the exclude file before you perform your tar.
Reply With Quote