tar syntax

tar syntax

Post by Mike Helle » Wed, 06 Jun 2001 08:39:28



Hello,

I'm trying to modify my backup command to exclude some directories as
the backup is getting too big for the tape.  I used to use a few
"--exclude PATTERN" options but now they are too numerous so I have
switched to the "--exclude-from=FILE" option instead.  My tar command
looks like this (in a script):

tar -cvpf /dev/nst0 --label="$name" --directory /
--exclude-from=EXCLUDE_FROM_BACKUP . >> $ymd

Any my exclude file looks like this:

---------------
*.exe
mnt
proc
'/big/no_backup/*'
'/big/backup/*'
'/big/download/*'
------------------

I tried using quotes and no quotes around the directories but neither
seems to work.  The man page says to quote it but the above file still
backs up the directories listed.  I don't backup "mnt" and "proc" but I
can't really switch from "/big/download/*" to just "download" as there
are directories that contain the word "download" that I DO want to
backup.  I'm just having some problems with the globbing syntax, where
am I going wrong?

In case this is relevant:
tar (GNU tar) 1.13.11
Linux 2.2.16-3smp #1 SMP Mon Jun 19 19:00:35 EDT 2000 i686

TIA,
Mike

 
 
 

tar syntax

Post by Lee All » Wed, 06 Jun 2001 22:06:29


On Mon, 04 Jun 2001 23:39:28 GMT, Mike Heller


>Hello,

>I'm trying to modify my backup command to exclude some directories as
>the backup is getting too big for the tape.  I used to use a few
>"--exclude PATTERN" options but now they are too numerous so I have
>switched to the "--exclude-from=FILE" option instead.  My tar command
>looks like this (in a script):

>tar -cvpf /dev/nst0 --label="$name" --directory /
>--exclude-from=EXCLUDE_FROM_BACKUP . >> $ymd

>Any my exclude file looks like this:

>---------------
>*.exe
>mnt
>proc
>'/big/no_backup/*'
>'/big/backup/*'
>'/big/download/*'
>------------------

(SNIP)

Partial answers:

To exclude /mnt and /proc, use '--one-file-system'.  That's probably
what you have in mind.

Through trial and error, here is how I exclude multiple specific
directories:
--exclude='*samba/sys/USERS/KATHY/*' \
--exclude='*samba/sys/USERS/JACK/*'

I suggest you look at the contents of your $ymd file, since you
specified the -v option to list the filenames; there you will see
exactly how the files are identified -- probably something like:
./big/download/filename
In which case you would specify something like:
--exclude='./big/download/*'

-Lee Allen

 
 
 

1. tar syntax question

Hi,

I'm trying to backup an AIX box using the following command:

find / -print | grep -v /netrs1/backup | tar cfL - >
/netrs1/backup/netrs1.tar 2> /netrs1/backup/netrs1.err

where netrs1 is the hostname, and /netrs1/backup is mounted on a remote box.

Anyway, what I'm trying to do is run tar on the / directory but exclude
directory /netrs1/backup. But the command I typed above doesn't work.
Could someone help me with the syntax please? (I'm using the AIX tar).

Thanks,

JS.

2. Solaris-C2 Compliance

3. Help with tar syntax please

4. DHCP on 2.1.6

5. Please help with tar syntax.

6. Future Domain TMC-850MER and Chinon CDS525 CD-ROM

7. TAR syntax

8. Extract message from telnet by program

9. TAR SYNTAX & UNKNOWN DEVICE

10. Tar Syntax Question

11. tar syntax

12. help: tar syntax

13. find/tar syntax problem