[Gllug] cpio question

Ben Fitzgerald ben_m_f at yahoo.co.uk
Sun Nov 6 18:36:25 UTC 2005


Hi,

I have a cpio archive which includes files marked as owned by root.

Let's nominally say it has the following:

$ cpio -it < archive
drwxr-xr-x   21 root     root      0 Nov 22 15:28 2004, .
drwx------    2 root     root      0 Dec 13 10:28 2002, lost+found
drwxr-xr-x   36 root     bin       0 Nov 22 13:58 2004, usr
-rwxr-xr-x    6 user1    user1     0 Nov 22 13:58 2004, usr/myfile
-rwxr-xr-x    6 user1    user1     0 Nov 22 13:58 2004, usr/myotherfile

I would like to create a new archive file which excludes usr/myfile.

If I want to do this as root I could simply extract the archive
excluding the file and then recreate the archive.

Trouble is that I want to do this as an ordinary user, so when I unpack
the archive I cannot create files/directories as root, so I loose these
permissions on recreating the archive.

Is there an easy way I can read my archive in, exclude files of a given
pattern and recreate my archive.

I'm trying to do this using cpio on solaris9 4/04 so it has less bells
and whistles than gnu cpio.

Can this be done without being root? I'd imagine if so it must be that
the archive is piped to avoid file creation.

Thanks,

Ben.
-- 
Registered Linux user number 339435
-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug




More information about the GLLUG mailing list