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 |
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. |
All times are GMT -5. The time now is 05:20 AM. |