Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 09-11-2013, 04:10 AM   #1
Registered: Dec 2006
Location: Russia,52
Posts: 119

Rep: Reputation: 6
Question find and cpio question

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

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, 04:38 AM   #2
Senior Member
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,842

Rep: Reputation: 1472Reputation: 1472Reputation: 1472Reputation: 1472Reputation: 1472Reputation: 1472Reputation: 1472Reputation: 1472Reputation: 1472Reputation: 1472
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, 08:29 AM   #3
Registered: Mar 2013
Posts: 633

Rep: Reputation: 141Reputation: 141
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.


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 02:23 AM
Transferring remote files via ssh,find,cpio locally metallica1973 Programming 11 11-28-2011 12:41 PM
CPIO and Find Operation not permitted errors metallica1973 Linux - Server 4 06-16-2011 03:58 PM
CPIO question nekkro-kvlt Linux - Software 2 06-10-2009 03:13 AM
[SOLVED] Bash script - how to use output from diff and find in context with cpio Mogget Programming 4 01-23-2009 10:38 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:48 AM.

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