Solved

what to see what cpio would do without writing

Posted on 2012-12-24
3
551 Views
Last Modified: 2012-12-31
I have two similar directories and I want to compare them to see what would be copied.

Normall I would cd to a dir and then just run the command:

find . -print | cpio -pdvm /foo/bar

but I cannot recall and worse find in the man to set cpio to read-only -- meaning just show me what it would have done. My memory tells me that I used to be able to do this. But I might have dreamt it since I cannot recall the last time I actually used that option.

The OS today is OS X 10.8.2
0
Comment
Question by:bs98909
3 Comments
 
LVL 77

Assisted Solution

by:arnold
arnold earned 50 total points
ID: 38718589
I do not believe cpio has a no-action mode.

You might be thinking of diff

Diff -BruN directory_origin directory_destination
The output will be a what changes need to be made to the origin directory contents to make it identical to the destination one.
Files should be regular files.

If you run the cpio you included, you will output the list of files that are copied.
0
 
LVL 29

Accepted Solution

by:
MikeOM_DBA earned 100 total points
ID: 38733265
You could also use the "dry run" option of rsync:
rsync -nrv directory_origin directory_destination

Open in new window

:p
0
 

Author Closing Comment

by:bs98909
ID: 38733589
Sorry for long delay -- holidays got in the way

both the diff and rsync would have worked -- but the rsync is more of what I was looking for

must have dreamt the cpio part
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Over the years I've spent many an hour playing on hardened, DMZ'd servers, with only a sub-set of the usual GNU toy's to keep me company; frequently I've needed to save and send log or data extracts from these server back to my PC, or to others, and…
How to remove superseded packages in windows w60 or w61 installation media (.wim) or online system to prevent unnecessary space. w60 means Windows Vista or Windows Server 2008. w61 means Windows 7 or Windows Server 2008 R2. There are various …
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now