euglug.org

[Eug-lug] tar up home for a nuke and pave

작성자

카테고리:



Bob MillerMon Feb 14 10:04:55 PST 2005

Mr O wrote:

> I've seen it come across the list before but don't know an easy
> way of searching the archives. How do I tar my home directory
> and a couple others so I can move them off disk to restore later
> with all permissions?

Tar always records the ownership and permission information.  The
trick is in untarring it correctly.  When you untar it, (a) be the
superuser and (b) supply the "p" flag.

	# tar xfzp somefile.tar.gz
	         ^
> Also, when restoring I should untar home first before creating
> the user right?

No.  Other way around.

-- 
Bob Miller                              K<bob>
kbobsoft software consulting
http://kbobsoft.com                     kbob at jogger-egg.com