Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I had a problem on my SunOS 5.5.1 installation, so I tried to restore from a backup. After the restoration completed, /var was empty. I have another workstation with the same OS. How could I get a copy of /var from one machine to the other?

share|improve this question
    
Why is /var empty ? How did you restore the file system ? Why are you using such an old and no more supported version of Solaris ? –  jlliagre May 18 '11 at 9:57
add comment

migrated from stackoverflow.com May 18 '11 at 13:21

This question came from our site for professional and enthusiast programmers.

1 Answer

If you've lost everything in /var, you have nothing to lose by copying over the whole contents of /var. I wouldn't advise copying the files though, as many of them will be machine-specific or tied to a particular machine state and most will be created automatically as needed. What you need to have is the directory structure. On the working machine, run this as root:

cd /var
find . -type d | cpio -o >/tmp/var.cpio

Copy the file var.cpio to the damaged machine and run this as root:

cd /var
cpio -i </tmp/var.cpio

If you discover files that must be copied as well, add them to the find expression above.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.