LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > General
User Name
Password
General This forum is for non-technical general discussion which can include both Linux and non-Linux topics. Have fun!

Notices


Reply
  Search this Thread
Old 08-06-2006, 02:57 PM   #1
consty
Member
 
Registered: Feb 2004
Location: Douala-Cameroun
Distribution: RedHAt 9 ES
Posts: 85

Rep: Reputation: 15
cpio and directories


Hi,
I have to backup directories trees and subdirectories on disk while maintaining owners, links and date. I would like to use cpio but the only problem is that the "m" option does'nt work when copying directories. Had anyone faced and solved that problem ?
Thanks for help
 
Old 08-12-2006, 12:16 PM   #2
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
Are you using find - if so you need to include the -depth option of find so it acts on the directories before the files in them.

The standard command line I've been using for years to make cpio archives (or backups to tape):

find . -depth |cpio -ovBc >file.cpio

Of course . could be substituted with a specific directory if you want the full path in the archive. The "file" I usually put in as the directory backed up so I'll know when I look at it later.

e.g.
find /var/named |cpio -ovBc >var_name.cpio

To read in such archives I always did:
cpio -ivBcumd <file.cpio

You could always try rsync instead if you're doing disk to disk copying.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
What am I doing wrong here with CPIO? pipkato Linux - Software 3 07-04-2006 10:26 AM
using cpio ksun Linux - Newbie 4 05-12-2006 05:14 AM
Searching multiple directories and sub directories for a file jeep99899 Linux - Newbie 2 10-13-2005 12:23 PM
How to use cpio to extract a cpio archive? linx win Debian 4 06-17-2005 01:53 PM
cpio.gz?? unprocessed Linux - Newbie 7 09-11-2002 04:37 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > General

All times are GMT -5. The time now is 05:09 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration