tar parameter --exclude-from

Jan-Benedict Glaw jbglaw at lug-owl.de
Tue Aug 5 08:17:35 CEST 2003


On Mon, 2003-08-04 18:47:58 +0200, Stefan Pump <lug at pumpnet.de>
wrote in message <007d01c35aa8$297a1ca0$0800a8c0 at joelle272>:
> 
> Die neuste Variante:
> stefan at elvis:/> tar -cvzP --exclude-from=/home/stefan/WWW/nonarchiv.txt -f
> /tmp/WWW.tgz /home/stefan/WWW
> stefan at elvis:/>

Also:

jbglaw at baerchen:~$ mkdir tartest
jbglaw at baerchen:~$ cd tartest/
jbglaw at baerchen:~/tartest$ mkdir subdir1
jbglaw at baerchen:~/tartest$ mkdir subdir2
jbglaw at baerchen:~/tartest$ touch subdir1/file11 subdir1/file12 subdir2/file21 subdir2/file22
jbglaw at baerchen:~/tartest$ echo ./subdir1/file11 > exclude_this
jbglaw at baerchen:~/tartest$ tar cvzf ../testtar.tar.gz --exclude-from=exclude_this .
./
./subdir1/
./subdir1/file12
./subdir2/
./subdir2/file21
./subdir2/file22
./exclude_this
jbglaw at baerchen:~/tartest$ tar --version
tar (GNU tar) 1.13.25
Copyright (C) 2001 Free Software Foundation, Inc.
This program comes with NO WARRANTY, to the extent permitted by law.
You may redistribute it under the terms of the GNU General Public License;
see the file named COPYING for details.
Written by John Gilmore and Jay Fenlason.
jbglaw at baerchen:~/tartest$

Funktioniert also. Worauf Du achten mußt, ist, daß alle
Datei-/Verzeichnisnamen (wobei ich nicht weiß, ob's mit Verzeichnissen
funktioniert, vermute das aber...) in der Exclude-Datei _exakt_ genau so
d'rinstehen, wie tar sie anzeigen würde, wenn Du "tar tzvf ..." machst.
Da ich meinen tarball erzeuge, indem ich das Verzeichnis "." einpacke,
müssen alle Dateien mit "./" anfangen (in der Exclude-Datei...).

MfG, JBG

-- 
   Jan-Benedict Glaw       jbglaw at lug-owl.de    . +49-172-7608481
   "Eine Freie Meinung in  einem Freien Kopf    | Gegen Zensur | Gegen Krieg
    fuer einen Freien Staat voll Freier Bürger" | im Internet! |   im Irak!
      ret = do_actions((curr | FREE_SPEECH) & ~(IRAQ_WAR_2 | DRM | TCPA));
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lug-owl.de/pipermail/linux/attachments/20030805/c3283c26/attachment.sig>


More information about the Linux mailing list