On Sunday 09 January 2011 21:11:02 Alex Schuster wrote:
> Mick writes:
> > I used:
> >  tar -X file.list -lcvSf - . | (cd /new_gentoo_partition; tar -xpvf - )
> > 
> > to clone a gentoo / partition to another partition on the same disk (I
> > want to run some tests from it).
> > 
> > The file.list has this is in it:
> > 
> > tmp/*
> > proc/*
> > sys/*
> > dev/*
> > etc/mtab
> > usr/portage/distfiles/*
> 
> Which also excludes /usr/include/sys, not only /sys. And so on. You
> probably have to rewrite this as ./tmp/* , but I did not test this.
> 
> And I just learnt that -l is no longer a synonym for --one-file-system,
> at least for tar 1.25. I'd do it with a bind mount this:
> 
> mount -o bind / /mnt
> cd /mnt
> tar -cvSf - . | (cd /new_gentoo_partition; tar -xpvf - )
> 
> This way, the original /dev is being copied (including entries console
> and null), without the udev stuff that is mounted on top of /dev, while
> with --one-file-system only the empty /dev directory would be created.

Thanks Wonko, it seems that I fell victim to my regex ignorance.  I started 
with /tmp, but that would also exclude the directories and I didn't fancy 
creating them manually afterwards.  Also dir/* does not include dir/.* 

What shall I use for excluding all the contents of a directory, but not the 
directory itself?

I'll need to experiment some more.

-- 
Regards,
Mick

Attachment: signature.asc
Description: This is a digitally signed message part.

Reply via email to