*BSD News Article 75348


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.carno.net.au!harbinger.cc.monash.edu.au!nntp.coast.net!news.kei.com!newsfeed.internetmci.com!in3.uu.net!nntp.inet.fi!news.funet.fi!news.cs.hut.fi!news.clinet.fi!not-for-mail
From: mickey@cantina.clinet.fi (Mika Ruohotie)
Newsgroups: comp.unix.bsd.freebsd.misc
Subject: Re: Best way to copy directory trees
Date: 3 Aug 1996 18:22:43 +0300
Organization: Clinet, Espoo, Finland
Lines: 36
Message-ID: <4tvqs3$7l8@cantina.clinet.fi>
References: <ts-0108961559090001@mac.infodirekt.de>
NNTP-Posting-Host: cantina.clinet.fi

Thomas Schreiber <ts@infodirekt.de> wrote:
>What is the best way to copy directory trees with preserving
>access dates, permissions, links and so on?

i do it this way:

mount the filesystems you want to copy to as /mnt /mnt2 /mnt3 or something
like that, doesnt matter i guess...

then assuming i want to move whole /usr, i cd to /usr new destination
/usr is /mnt and then:

find * -print | cpio -pdmv /mnt

havent ever had any problems with it... as long as you remember to cd
to the source filesystem...

then ofcourse, you have to twiddle with the /etc/fstab, after that you
just reboot and if all boots up well, you are free to rm -rf the old
filesystem that had /usr, i rather boot up first before deleting just
incase something went bad...

note that you have to rename the old /usr to something else, cant have two
of those... =)

(since i dont know your level of knowledge i try to be exact, sorry if i
mentioned things you'd do automaticly)

oh yeah, and since i use zsh i always hit <tab> after i've typed 'find *'
so that i see exactly what i am doing, i never leave *s on commandline,
lesson several bad 'rm -rf's taught me a long time ago...

>Thomas


mickey