Jim Gibson wrote:
> At 10:50 PM -0400 9/28/09, Steve Bertrand wrote:
>> xufengnju wrote:
>>>  Hi all,
>>>  I have a storage server that holds one million of images with well
>>> structured directory structure such as
>>>
>>>  /data/user1/2008/09/12/image1.jpg
>>>  /data/user1/2008/09/12/image2.jpg
>>>  ...
>>>  /data/user2/2009/01/01/image1.jpg
>>>  ...
>>>
>>>  I want to copy them to the /data2 directory in the same server on
>>> another disk partion.
>>>  I want to keep the directory structure and `chown` && `chmod` the
>>> directories and files,much like doing a `cp -rf /data /data2 && chown
>>> -R sysuser:sysuser /data2 && chmod -R 755 /data2`.
>>>
>>>  File::Find maybe an option.
>>>  Is there somebody who have some suggestions?
>>>
>>>  If I do a `cp -rf /data /data2 && chown -R sysuser:sysuser /data2 &&
>>> chmod -R 755 /data2`,how much time maybe taken to finish the job?(The
>>> images are about one million in count and 250GB in size totally).
>>
>> Perhaps I am missing something completely obvious. If not:
>>
>> Why-oh-why do you want to use Perl do perform such a task?
>>
>> Use dump/restore (which I can't recall a cli sequence for off the top of
>> my head), or rsync:
> 
> 
> tar can also be used to copy a hierarchy of directories and files. You
> pipe the output of one tar into the input of another. From 'man tar':
> 
>      To move file hierarchies, invoke tar as
>            tar -cf - -C srcdir . | tar -xpf - -C destdir


This conversation brings me back quite a ways, when I was writing
'howtos' as such:

http://ipv6canada.com/docs/clone_freebsd.php

http://ipv6canada.com/docs/remote_tarball.php

http://ipv6canada.com/docs/partition_table.php

...ugly, poor grammar, email addresses that don't work, but datestamps
that bring me back and remind me that my 'php' files have followed my
web server upgrades... :)

Steve

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

Reply via email to