LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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, 04:10 AM   #1
sluge
Member
 
Registered: Dec 2006
Location: Russia,52
Posts: 128

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

Rep: Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513
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
eklavya
Member
 
Registered: Mar 2013
Posts: 636

Rep: Reputation: 142Reputation: 142
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



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

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:19 PM.

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
Open Source Consulting | Domain Registration