How to exclude file in tar backup?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting How to exclude file in tar backup?
# 1  
Old 10-27-2005
How to exclude file in tar backup?

I am taking a backup of area with the following command:-

tar -cf -./* |/usr/contrin/bin/gzip >xxx.tar.gz.

The area contains following files :-
xxxx
yyyy
zzzzz
asdaD
DASdD
WQWEE

I want to backup all the files except yyyy from the following area.
I checked manual page of tar but I didn't came across anything that was helpful.
# 2  
Old 10-27-2005
You did not mention which OS.
GNU tar has the following:
Code:
       --exclude FILE
              exclude file FILE

       -X, --exclude-from FILE
              exclude files listed in FILE

vino
# 3  
Old 10-27-2005
I am using HP-UX 11.0.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Solaris

TAR exclude is not working !

I have solaris 10 and my following exclude is not working: tar -cvf /export/home/backups/$audit-Data-$useday.bkup.tar /Data --exclude=/Data/ssg/output a /Data/ssg/output/ 0K a /Data/ssg/output/ssg-ported508.txt 107142K a /Data/ssg/output/ssg-ported747.txt 1801K a... (4 Replies)
Discussion started by: mrn6430
4 Replies

2. UNIX for Dummies Questions & Answers

UNIX Tar file backup

I want to create a tar file that backup all my recent work. I have no idea how Tar file works and I am new to Unix Please help (1 Reply)
Discussion started by: GGBEASTBOI
1 Replies

3. UNIX for Dummies Questions & Answers

Exclude file with tar

hi, i am trying to use a exclude file to exclude some file directories while making a tar archive. This is my command: tar -pcvf orahome10gR2.tar.gz db_1 -X /home/oracle/excludeFile.txt /home/oracle/ when i execute it, it seem to be tar-ing. But once is done, i cd to /home/oracle and could... (2 Replies)
Discussion started by: redologger
2 Replies

4. AIX

How to exclude directory from (File Systems) backup?

Hello AIX experts, I have a file system called /bossapp Its size = 77.5 GB I want to take a File Systems backup for this one using smitty, it is very easy, but the problem is I want to exclude one directory called (ORIGIN). How? The steps are very easy to take a File Systems backup,... (2 Replies)
Discussion started by: Mohannad
2 Replies

5. Solaris

exclude absolute paths when extracting Tar file?

Hi, How do I extract data from TAR excluding absolute paths for Tar? (Solaris) Thanks (3 Replies)
Discussion started by: zam
3 Replies

6. Shell Programming and Scripting

File Backup - TAR help

Hi, Another rookie here. I have a script I am developing to backup files from various directories onto a windows machine. Script description: - mv files from various directories - tar all files in that directory - export to windows server for safe keeping, external backups. The... (5 Replies)
Discussion started by: mcclunyboy
5 Replies

7. SCO

Tar exclude

Hi, We work on a UNIX SCO SCO_SV Release = 3.2v5.0.5. I have a folowing structure /u/usr/lpp /u/usr/lpp/SQL /u/usr/lpp/DIR2 I use following tar to backup the /u/usr/lpp directory cd /u/usr/lpp tar cvf /u/usr/backup/backup.tar . Now I want to exclude the subdirectory SQL. I... (2 Replies)
Discussion started by: haezeban
2 Replies

8. AIX

how to take tar backup of the contents of a file

Hi I have a file named files.2.backup which holds the location of some directory and file i,e $ cat files.2.backup /d01/app/oracle/product/7.3.2/dbs/fortest_syst_01.dbf /d01/app/oracle/product/7.3.2/dbs/fortest_temp_01.dbf /d01/app/oracle/product/7.3.2/dbs/fortestdata_01.dbf... (5 Replies)
Discussion started by: sumanbangladesh
5 Replies

9. Filesystems, Disks and Memory

Tar file from Linux server to PC for backup

I have a Linux email server, I want to backup all /home /var... by tar command and copy to my PC for backup everyweek. The Linux serve rhave ftp function. Is there any program to help backup my file? any url welcome many thank. (8 Replies)
Discussion started by: zp523444
8 Replies

10. UNIX for Dummies Questions & Answers

Getting 'tar' to exclude

I want 'tar' to exclude certain dir's. tar cvf ............. ............ does the whole lot, but I want to exclude the 'log' dirs. (6 Replies)
Discussion started by: kuultak
6 Replies
Login or Register to Ask a Question