[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: excluding files w/ tar




On Thu, 2 Jun 2005, Winston Smith wrote:

> My suggestion above assumes you use tar cv -X /tmp/excludes -p
> --atime-preserve ./* -- | ... 
>                                             ^^^ instead of tar cv -X
> /tmp/excludes -p --atime-preserve * -- | ... 

its supposed to be

tar cf  menas you want a file

	tar zcf tar-file.tgz

tar -X means you want to exclude "it" from the tar-file.tgz

if you wantto exclude a bunch of um

vi /tmp/excludes.txt
	-X /tmp
	-X /proc
	-X /BACKUP
	-X /var/log

-- new example

	tar zcvf /BACKUP/tar-file.tgz -X `cat /tmp/excludes.txt`

	#
	# quickie test to ignore host* files and /etc/gconf
	#
	tar zcvf /tmp/t.tgz  /etc --exclude /etc/hosts* \
		--exclude /etc/gconf --exclude /etc/selinux

-- i prefer --exclude instead of -X
	for excluding directories in addition to files

c ya
alvin



Reply to: