LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   how to copy-in cpio archive to temp directory (https://www.linuxquestions.org/questions/slackware-14/how-to-copy-in-cpio-archive-to-temp-directory-422664/)

jxi 03-07-2006 09:16 PM

how to copy-in cpio archive to temp directory
 
sometime back I had a way to copy-in from a cpio file to a temp directory,
or, to put it another way, copying directory tree(s) stored in a cpio archive
to a mount pt other than /

but I forgot how.

i;m creating cpio files with this command:
Code:

cat FILES |cpio -aov -H crc | gzip --best - > filename.crc.gz
where FILES looks like

/home/jxi/.ICEauthority
/home/jxi/.bash_history
/home/jxi/.Xauthority
...and so on. files from /home /etc /root ...

I want to copy-in (reload) the files onto a temp space for the purpose of running `diff -r` against the contents of a 'parallel' tar command's resulting file , i.e, one created in the same script about the same time.
(I'm looking at replacing tar with cpio for scheduled backups )

but when i issue e.g.,
(gunzip file into /tmp)
Code:

  mkdir /tmp/cpio_dump
  cd /tmp/cpio_dump
  cpio -i -vdm </tmp/filename.crc

... it starts trying to replace the files in their original places starting at /

if ./ follows the command it does nothing (ctrl-c is needed to kill it)

Now, cpio pass-thru mode lays down dirs, files in a new location easily as in:

Code:

cd <directory-structure-to-be-copied>
find . -xdev -print | cpio -pdumv <path_to_new_directory>

... how to get this action with copy-in mode?

unSpawn 03-08-2006 04:15 PM

and if you use cpio with --no-absolute-filenames?: "In copy-in mode, create all files relative to the current directory".

jxi 03-08-2006 04:32 PM

thanks, unSpawn , that's it exactly

the description is sitting right there in info cpio but i must have overlooked it.


All times are GMT -5. The time now is 04:36 AM.