[comp.unix.questions] How can I read a cpio archive with absolute pathnames?

friedl@vsi.UUCP (Stephen J. Friedl) (03/18/88)

Hi folks,

     Customers are always dumping cpio archives to floppy with

	find / -print | cpio ...

and it drives us crazy when we need to restore something and they
have used full pathnames.  Are there methods short of either the
interactive rename mechanism or making a silly chroot environment
for it?  Wouldn't it be really helpful if cpio had an option that
could edit the start of the path to (say) prepend "." or strip off
parts?

     Steve

-- 
Steve Friedl, KA8CMY     ARPA/UUNET/CSNet: friedl@vsi.com       *Hi Mom*
{kentvax, uunet, attmail, {ucbvax, ihnp4, sun}!amdcad!uport}}!vsi!friedl
"It's sad we judge others by their actions and ourselves by our motives"

itkin@cup.portal.com (03/22/88)

>     Customers are always dumping cpio archives to floppy with
>
>	find / -print | cpio ...
>
>and it drives us crazy when we need to restore something and they
>have used full pathnames.  Are there methods short of either the
>interactive rename mechanism or making a silly chroot environment
>for it?  Wouldn't it be really helpful if cpio had an option that
>could edit the start of the path to (say) prepend "." or strip off
>parts?
>-- 
>Steve Friedl, KA8CMY     ARPA/UUNET/CSNet: friedl@vsi.com       *Hi Mom*
>{kentvax, uunet, attmail, {ucbvax, ihnp4, sun}!amdcad!uport}}!vsi!friedl

This is one of those rare uses for the CHROOT command.  The steps are:

	chroot /sparedir cpio...

I'd read the manual very carefully, and try it with something not too
destructive.  Once done, the files will have been retrieved RELATIVE TO
/sparedir AS THOUGH IT WERE THE ROOT.  You can then move them or whatever
you want to do with them.

friedl@vsi.UUCP (Stephen J. Friedl) (03/23/88)

In article <4019@cup.portal.com>, itkin@cup.portal.com writes:
> In article <407@vsi.UUCP>, I lament:
> > Customers are always dumping cpio archives to floppy with
> >
> >	find / -print | cpio ...
> >
> >and it drives us crazy when we need to restore something and they
> >have used full pathnames. [...]
> 
> This is one of those rare uses for the CHROOT command.  The steps are:
> 
> 	chroot /sparedir cpio...

/etc/chroot is sadly not as simple as it looks: you have to create
a whole directory tree under /sparedir: it has to contain:

	/sparedir/bin/cpio
	/sparedir/dev/tty	if you run multiple volumes
	/sparedir/dev/rmt0	or whatever, if you run multiple volumes
	/sparedir/bin/mkdir
	/sparedir/shlib/libc_s	for SVR3

at least.  This is tedious and I really hate to bother setting it
up all the time.  Sigh, I wish cpio had an option...

     Steve

-- 
Steve Friedl      V-Systems, Inc.        *Hi Mom*
friedl@vsi.com   {uunet,attmail,ihnp4}!vsi!friedl

zeeff@b-tech.UUCP (Jon Zeeff) (04/06/88)

In article <434@vsi.UUCP> friedl@vsi.UUCP (Stephen J. Friedl) writes:
>In article <4019@cup.portal.com>, itkin@cup.portal.com writes:
>> In article <407@vsi.UUCP>, I lament:
>> > Customers are always dumping cpio archives to floppy with
>> >
>> >	find / -print | cpio ...
>> >
>> >and it drives us crazy when we need to restore something and they

There is a comp.sources program called fixcpio that fixes damaged cpio 
archives (it's great for skipping over that one bad spot in a set of 
floppy backups).  It could be easily modified to remove a leading / 
from files names.  

--Jon
-- 
Jon Zeeff           		Branch Technology,
uunet!umix!b-tech!zeeff  	zeeff%b-tech.uucp@umix.cc.umich.edu

itkin@cup.portal.com (05/09/88)

>In article <434@vsi.UUCP> friedl@vsi.UUCP (Stephen J. Friedl) writes:
>>In article <4019@cup.portal.com>, itkin@cup.portal.com writes:
>>> In article <407@vsi.UUCP>, I lament:
>>> > Customers are always dumping cpio archives to floppy with
>>> >
>>> >	find / -print | cpio ...
>>> >
>>> >and it drives us crazy when we need to restore something and they
>
>There is a comp.sources program called fixcpio that fixes damaged cpio 
>archives (it's great for skipping over that one bad spot in a set of 
>floppy backups).  It could be easily modified to remove a leading / 
>from files names.  
>-- 
>Jon Zeeff           		Branch Technology,

How about keeping it simple?  Use 'chroot' to specify a new root directory
relative to something you like and then move/rename the file once it's there.

randy@chinet.UUCP (Randy Suess) (05/11/88)

In article <5232@cup.portal.com> itkin@cup.portal.com writes:
]>
]>There is a comp.sources program called fixcpio that fixes damaged cpio 
]>archives (it's great for skipping over that one bad spot in a set of 
]>floppy backups).  It could be easily modified to remove a leading / 
]>from files names.  
]>Jon Zeeff           		Branch Technology,
]
]How about keeping it simple?  Use 'chroot' to specify a new root directory
]relative to something you like and then move/rename the file once it's there.

	Oh?  And where is the person that just chroot'd going to find
	cpio, /dev/whatever, etc?  Turns out that you need a whole
	bunch of programs moved to the subdirectory you want to
	be in.  Chroot is not a nice command.
	Seems Jon's idea is simpler.

-randy


-- 
that's the biz, sweetheart.....
Randy Suess
..!att!chinet!randy

sullivan@vsi.UUCP (Michael T Sullivan) (05/12/88)

In article <5506@chinet.UUCP>, randy@chinet.UUCP (Randy Suess) writes:
> In article <5232@cup.portal.com> itkin@cup.portal.com writes:
> ]>
> ]>There is a comp.sources program called fixcpio that fixes damaged cpio 
> ]How about keeping it simple?  Use 'chroot' to specify a new root directory
> ]relative to something you like and then move/rename the file once it's there.
> 	be in.  Chroot is not a nice command.
> 	Seems Jon's idea is simpler.

Jon's idea was much simpler.  I got fixcpio, made a few quick mods,
and it does just what we want it to do.  Quick and easy, how nice.

-- 
Michael Sullivan		{uunet|attmail}!vsi!sullivan
				sullivan@vsi.com
HE V MTL			Anybody out there remember Max Webster?