Sponsored Content
Full Discussion: GNUTAR exclude directories
Top Forums UNIX for Advanced & Expert Users GNUTAR exclude directories Post 35666 by TheBlueLady on Friday 25th of April 2003 03:38:54 AM
Old 04-25-2003
Hi oombera,

What Perderabo wrote sounds good, but really doesn't work for me, I just tried it again, the temp-directories still are in the archive. Also the way you described didn't work for me. Then the temp-directories are again in my archive.

But I've got a way that does work for me, it is not ideal, but it is working. It is the following:
tar -cvf /tmp/datadir.tar --exclude=temp1 --exclude=temp2 --exclude=temp3 /appl/data

You were also wondering why I am concerned with this. Well that is because of my daily backup of the whole system. Every day I want to make a backup on tape of the whole system, but not of the temp-directories. While the backup is being made other proces can be running changing files in the tempdirectories. Files in these directories change while in the meantime backup is trying to write them to tape, because of this the backup can crash. So that is the reason. Hope you understand me.
Anyway I am very thankful for all your help. Smilie
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

find command to exclude directories

Howdy I have this directory structure ... eep eepaptest eepfatest eepgltest eep.old eeppoptest ehf ehfaptest ehfgltest ehp ehpgltest I want to find files in these directories, but I want to exclude eep, ehf & ehp. Cany anyone help with the correct command ?? (1 Reply)
Discussion started by: SmurfGGM
1 Replies

2. Shell Programming and Scripting

Find but exclude directories

Hello, I have a line in my script to find the files changed in the last 24 hours. It is as below: find /home/hary -type f -mtime -1 I now want to exclude a directory named "/home/hary/temp/cache" from the above find command. How do I add it to my script? Any help is appreciated. ... (9 Replies)
Discussion started by: tadi18
9 Replies

3. UNIX for Dummies Questions & Answers

How to Exclude multiple directories from find command?

Hi, Can some one help me how to exclude multiple directories using find command.. I have the directory structure below. /a/a1/b1 /a/c1/c2 /a/d1/d2/d3 I want to exlcude a1,c2and d3 from the above using find,can some one suggest pls.. thanks in advance... Use code tags... (1 Reply)
Discussion started by: jagadish_gaddam
1 Replies

4. Shell Programming and Scripting

Help - Find command to exclude sub-directories

Hi Forum. I'm trying to write a script that finds and deletes files that are older than 300 days. The script will read a table that contains the following 3 columns: 1st col: “Y” means sub-directory scan; "N" means no subdirectory scan 2nd col: sub-directory location 3rd col: File prefix... (7 Replies)
Discussion started by: pchang
7 Replies

5. Shell Programming and Scripting

How to exclude the empty directories

Hi., I have a script, in which I am processing a files present in the directory types. ls -lrt | grep ^d | grep Dir_type | awk -f '{print $9}' |\ while read dir_name; do #operations done where Dir_type is the pattern in which directories get created. How to filter out empty... (2 Replies)
Discussion started by: IND123
2 Replies

6. Shell Programming and Scripting

Perl exclude directories in command line

Hi, I use find command to list all the files in a directory and its sub-directories, but the problem is to exclude certain directories during search. Can i give the directory names in command line to skip them and search rest of the directories? For example i have directories: test ../test1... (1 Reply)
Discussion started by: nmattam
1 Replies

7. Shell Programming and Scripting

Global Pattern - exclude directories

All, I am trying delete folder by adding pattern not to delete certain folders. But i struck with error. When i use below command from command line, it works fine. shopt -s extglob rm -rf !(test1|test2|test3) But when i use the same in shell script, i get the below error. syntax... (6 Replies)
Discussion started by: vino_hymi
6 Replies

8. AIX

Exclude Directories in my tar command

Hi, im having some issues after i execute the next command: tar -cvf /varios/restore/test.tar -X /jfma/test1/excludefile /jfma | gzip -c > /varios/restore/test.tar.gz this creates the desired "test.tar.gz" file, but whe i try to open it it says "tar: 0511-164 There is a media read or write... (6 Replies)
Discussion started by: blacksteel1988
6 Replies

9. Shell Programming and Scripting

Exclude directories in FIND command

Can you please help tweak the below command to exclude all directories with the name "logs" and "tmp" find . -type f \( ! -name "*.tar*" ! -name "*.bkp*" \) -exec /usr/xpg4/bin/grep -i "user_1" /dev/null {} + >result.out bash-3.2$ uname -a SunOS mymac 5.10 Generic_150400-26 sun4v sparc sun4v... (9 Replies)
Discussion started by: mohtashims
9 Replies
BACKUP-WHATSTHIS(1)						   Chiark-backup					       BACKUP-WHATSTHIS(1)

NAME
backup-whatsthis - read an id off a tape and display it SYNOPSIS
backup-whatsthis [--list [n]] DESCRIPTION
`backup-whatsthis' is a simple script to display the TAPEID of the current tape and optionally list its contents. This script is a bit of a hack and may not be fully reliable. OPTIONS
--list [n] Print TAPEID then list archive n (default 0). Note that archives are numbered from zero. FILES
/etc/chiark-backup/settings.pl Configuration file for the whole of chiark-backup BUGS
`backup-whatsthis' is currently hardwired to assume `cpio' type backups when listing; it could be trivially hardwired to assume `zafio' or with slightly more effort it could be done properly :->. AUTHOR
This Manual page was written by Matthew Vernon <matthew@debian.org> but may be used by anyone. COPYRIGHT
Copyright (C) 1997-1998,2000-2001 Ian Jackson <ian@chiark.greenend.org.uk> Copyright (C) 1999 Peter Maydell <pmaydell@chiark.greenend.org.uk> This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICU- LAR PURPOSE. Debian July 2003 BACKUP-WHATSTHIS(1)
All times are GMT -4. The time now is 07:58 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy