[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Bug-tar] (forw) tar --listed-incremental bogous?
From: |
Sergey Poznyakoff |
Subject: |
Re: [Bug-tar] (forw) tar --listed-incremental bogous? |
Date: |
Tue, 17 Feb 2004 15:03:38 +0200 |
Andreas Schuldei <address@hidden> wrote:
> While it is possible to operate on directories when creating the
> compressable archive and --exclude *.bz2 ... all the
> uncompressable files, i cant think of a way to
> operate on directories while taring up all the compressable
> files. so i settled with creating a file list with find, and tar
> all those files. if you tell me a way to operate on directories
> (on tar`s level) while still catching all the uncompressable
> files i will gladly do so.
I see. Here is how you can do it:
# Variables:
# ARCH - tar archive that keeps all non-compressed files
# SNAPSHOT - correspondig listed-incremental snapshot
# ARCH_COMPRESSED - tar archive that keeps all compressed files
# ARCH_COMPRESSED - correspondig listed-incremental snapshot
# Archive the non-compressed files:
tar --create --file $ARCH \
--listed=$SNAPSHOT \
--exclude='*.Z' \
--exclude='*.gz' \
--exclude='*.bz2' \
--exclude='*.tgz' \
$DIR
# Archive all the compressed files:
find $DIR \! -path $DIR \! \
\( -name '*.Z' -or -name '*.gz' -or -name '*.bz2' -or -name '*.tgz' \) |
tar --create --file $ARCH_COMPRESSED \
--listed=$SNAPSHOT_COMPRESSED \
--exclude-from=- \
$DIR
Regards,
Sergey