LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-11-2013, 05:10 AM   #1
sluge
Member
 
Registered: Dec 2006
Location: Russia,52
Posts: 116

Rep: Reputation: 6
Question find and cpio question


Hello!
In all examples that ralated to find and cpio find is always used with currect folder . :

Code:
find . -depth -print | cpio -oaV > archive.cpio
But why? Is any troubles if I will specify something like /home/user as a find argument?
 
Old 09-11-2013, 05:38 AM   #2
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,604

Rep: Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241
You asked the same question over on the Fedora forums. I'll give the same answer here:

You embed the full path into the archive.

This can make it more problematical when you try to extract a single file - with the full path embedded it has to go back to exactly where it was, which doesn't work if the files are to be restored to a different username on a different system.

It isn't a problem if that is exactly what you want to do - every time.

Most such extractions I have done though, require the extracted file to be separate - it may be because I need to do a diff between the backed up file, and the current file.

This happens so often that tar even removes the leading "/" to make such use possible even with the full path specified. You can override tars removal, but it saves time.
Edit/Delete Message
 
Old 09-11-2013, 09:29 AM   #3
eklavya
Member
 
Registered: Mar 2013
Posts: 619

Rep: Reputation: 136Reputation: 136
Here are some examples where they have used find with cpio to take back up but they did not use . (current directory) they have used absolute path.
http://www.cyberciti.biz/faq/how-do-...d-under-linux/
http://http418.net/copying-stuff-with-find-and-cpio/
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] find -print along with cpio vahab Linux - General 1 12-10-2012 03:23 AM
Transferring remote files via ssh,find,cpio locally metallica1973 Programming 11 11-28-2011 01:41 PM
CPIO and Find Operation not permitted errors metallica1973 Linux - Server 4 06-16-2011 04:58 PM
CPIO question nekkro-kvlt Linux - Software 2 06-10-2009 04:13 AM
[SOLVED] Bash script - how to use output from diff and find in context with cpio Mogget Programming 4 01-23-2009 11:38 AM


All times are GMT -5. The time now is 05:28 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration