Using cpio with the find command


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Using cpio with the find command
# 1  
Old 04-22-2009
Using cpio with the find command

Hey everyone,

I’ am a newbie to Unix. Learning some of the basic commands.

I did some piping before like who | wc

I wanted to practice some backup features in Unix. I’ am practicing using cpio and place it into a file named backup. I’m not quite sure where I’ am going wrong?

backup > cpio -v | ./find

The command seems to run fine but does not create a file named backup??(backing up my login directory)

Any suggestions?

John
# 2  
Old 04-22-2009
Suppose you want to make a copy of the underlying directories and files of /home/dat to /home/backup:

Code:
cd /home/dat
find * -print | cpio -pvdmu /home/backup

For the used options of cpio you can check the man page of cpio.

Regards
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Cpio - input files (from list) are stored in different order inside cpio archive - why?

Due to budget constraints I have to reinvent an Enterprise backup system in a SPARC (sun4v) Solaris estate (10 & 11). (yep - reinvent wheel, fun but time consuming. Is this wise?! :confused: ) For each filesystem of interest, to try to capture a 'catalog' at the front of each cpio archive (for... (1 Reply)
Discussion started by: am115998
1 Replies

2. Solaris

About cpio command

i need to extract cpio file archived full path to /restore/ (not full path or fullpath under this directory ) i can't find option for cpio please help me example. i have cpio file archive /etc/* and i need to extract file to /restore #cpio -ivBcdmu < xx.cpio but data from cpio not... (3 Replies)
Discussion started by: infjustice
3 Replies

3. Shell Programming and Scripting

How to use grep & find command to find references to a particular file

Hi all , I'm new to unix I have a checked project , there exists a file called xxx.config . now my task is to find all the files in the checked out project which references to this xxx.config file. how do i use grep or find command . (2 Replies)
Discussion started by: Gangam
2 Replies

4. Linux

Simplified find command to find multiple file types

Hi, I'm using the following command to find the multiple requierd file types and its working fine find . -name "*.pl" -o -name "*.pm" -o -name "*.sql" -o -name "*.so" -o -name "*.sh" -o -name "*.java" -o -name "*.class" -o -name "*.jar" -o -name "*.gz" -o -name "*.Z" -type f Though... (2 Replies)
Discussion started by: vickramshetty
2 Replies

5. UNIX for Dummies Questions & Answers

how to find a file named vijay in a directory using find command

I need to find whether there is a file named vijay is there or not in folder named "opt" .I tried "ls *|grep vijay" but it showed permission problem. so i need to use find command (6 Replies)
Discussion started by: amirthraj_12
6 Replies

6. UNIX for Dummies Questions & Answers

advantages of cpio command?

hi, can any body tell me the advantages of having cpio command over tar command (7 Replies)
Discussion started by: prasannak
7 Replies

7. Shell Programming and Scripting

Little bit weired : Find files in UNIX w/o using find or where command

Yes , I have to find a file in unix without using any find or where commands.Any pointers for the same would be very helpful as i am beginner in shell scritping and need a solution for the same. Thanks in advance. Regards Jatin Jain (10 Replies)
Discussion started by: jatin.jain
10 Replies

8. UNIX for Dummies Questions & Answers

Restoring a directory using cpio command?

I am confused with how to restore archives. I just figured out the use of tar, but now after trying it with cpio, I'm unsure of some things. Firstly, is it necessary to cd to the directory you will be restoring to in order to run this command? Secondly, what is it I'm doing wrong when trying to... (2 Replies)
Discussion started by: Relykk
2 Replies

9. Shell Programming and Scripting

command find returned bash: /usr/bin/find: Argument list too long

Hello, I create a file touch 1201093003 fichcomp and inside a repertory (which hava a lot of files) I want to list all files created before this file : find *.* \! -maxdepth 1 - newer fichcomp but this command returned bash: /usr/bin/find: Argument list too long but i make a filter all... (1 Reply)
Discussion started by: yacsil
1 Replies

10. UNIX for Dummies Questions & Answers

cpio command with compress

Hi friends.. I want to be able to copy a file from one location to another (locally). The location the files are copied to should have compressed instances of the files they were copied from. copy from /home/user/test.file copy to /backup/user/test.file.Z I need to be able to do this... (1 Reply)
Discussion started by: sureshy
1 Replies
Login or Register to Ask a Question