Your Ad Here

Senin, 07 September 2015

Unix Tip: RECREATING DIRECTORY TREES

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

UNIX GURU UNIVERSE
UNIX HOT TIP

Unix Tip 3498 - September 7, 2015

http://www.ugu.com/sui/ugu/show?tip.today

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=


RECREATING DIRECTORY TREES

This problem frequently
occurs. There is a machine
with a complex directory
structure, and you want to
have a copy of this directory
tree on another machine.

It is for testing purposes
(for example), and you want
to copy permissions,
UID/GID, and the directory
tree but don't want to copy
user files.

Here is the fastest
solution:
machine_a # cd /mydir
machine_a # find . -depth -print | cpio -o -O /tmp/dir.cpio

Copy the dir.cpio to
another machine.

machine_b # mkdir /mydir ; cd /mydir
machine_b # cat /tmp/dir.cpio | cpio -id


This tip generously supported by: paul@dataware.hu



--------------------------------------------------------------------------
To Subscribe: http://www.ugu.com/sui/ugu/show?tip.subscribe
To Unsubscribe: http://www.ugu.com/sui/ugu/show?tip.unsubscribe
To Submit A Tip: http://www.ugu.com/sui/ugu/show?tip.today

==========================================================================
DISCLAIMER: All UNIX HOT TIPS ARE OWNED BY THE UNIX GURU UNIVERSE AND ARE
NOT TO BE SOLD, PRINTED OR USED WITHOUT THE WRITTEN CONSENT OF THE UNIX
GURU UNIVERSE. ALL TIPS ARE "USE AT YOUR OWN RISK". UGU ADVISES THAT
ALL TIPS BE TESTED IN A NON-PRODUCTION DEVELOPMENT ENVIRONMENT FIRST.

Unix Guru Universe - www.ugu.com - tips@ugu.com - Copyright 1994-2001
==========================================================================

Tidak ada komentar:

Posting Komentar

Your Ad Here
Free Automatic Backlink Free Auto Backlink Free Auto Backlink Free Auto Backlink Free Auto Backlink Free Auto Backlink Free Auto Backlink Free Auto Backlink Free Auto Backlink Free Auto Backlink