[olug] Unix Tip: MOVING FILES WITH CPIO

drose.SCANTRON at scantron.com drose.SCANTRON at scantron.com
Fri Apr 11 15:16:34 UTC 2003


1.  In the old days you could not copy files across file systems.  Using
tar or cpio was the only way that you could copy files.  I have not used
this method in a long time.

2.  CPIO is needed in older unix's.  TAR will not backup 0 length files,
but cpio will.  I use CPIO on a daily occurrence to backup and restore
systems.


Daryl Rose
Unix Support Specialist
drose at scantron.com
1-800-228-3628 x3061


                                                                                                                                       
                      Brian Wiese                                                                                                      
                      <bwiese at cotse.com        To:       Omaha Linux User Group <olug at olug.org>                                        
                      >                        cc:                                                                                     
                      Sent by:                 Subject:  Re: [olug] Unix Tip: MOVING FILES WITH CPIO                                   
                      olug-bounces at olug                                                                                                
                      .org                                                                                                             
                                                                                                                                       
                                                                                                                                       
                      04/07/2003 03:56                                                                                                 
                      PM                                                                                                               
                      Please respond to                                                                                                
                      Omaha Linux User                                                                                                 
                      Group                                                                                                            
                                                                                                                                       
                                                                                                                                       




Whats the big purpose with using cpio, why not just "cp -xpvr /old /new"?

       -x, --one-file-system
              stay on this file system
       -p     same as --preserve=mode,ownership,timestamps
       -R, -r, --recursive
              copy directorie
       -v, --verbose
              explain what is being dones recursively  ?? necessary?

What does cpio buy you?  Does anyone ever use it? =)

On Mon, 7 Apr 2003 12:16:19 -0700
Unix Guru Universe <listserv at ugu.com> wrote:

|MOVING FILES WITH CPIO
|
|If you have a multitude of
|files to move from one
|directory or filesystem to
|another, here's a one liner:
|
|# find /old_directory -depth | cpio -pdmv /new_directory
|
|This will move all of the
|files under the specified
|old_directory to the
|new_directory, keeping the
|same ownership, permissions,
|and directory structure.


  Brian Wiese | bwiese at cotse.com | aim: unolinuxguru
------------------------------------------------------
  GnuPG/PGP key 0xF3220030 | "FREEDOM!" - Braveheart
------------------------------------------------------
This is not about Napster or DVDs. It's about your Freedom.
  I'll see your DMCA and raise you a First Amendment.
              http://www.anti-dmca.org
_______________________________________________
OLUG mailing list
OLUG at olug.org
http://lists.olug.org/mailman/listinfo/olug







More information about the OLUG mailing list