Solved

dd / cpio backup problem

Posted on 1997-11-10
2
935 Views
Last Modified: 2008-03-06
The following script returns sometimes an error-Code

rsh -n server " cd /; find . -print| grep -v \"^./cdrom/\"  \
        | grep -v \"^./home/\"  \
        | grep -v \"^./usr/\"  \
        | cpio -o -c -B " \
| dd of=/dev/rmt/0 bs=5k
(time for backup: total 4h )

1) dd returns sometimes an "dd: unexpected short write wrote 0 bytes,expected 5120".Is this an error ?
2) Is it possible that cpio is not working correctly if some files were deleted/changed during backup ?
thanks for help
Bernd
0
Comment
Question by:bzimmermann
2 Comments
 
LVL 1

Accepted Solution

by:
Taliesin earned 200 total points
ID: 2007668
1) Nope, it's a warning message, you are trying to write
  with dd an empty output from cpio, then it's a cpio error.

2) Yep, that's because you are using too many pipelines and
  a slow tape write, you should try making it faster, with
  a local find, and checking the output before doing the cpio/dd
  pipe.


example: rsh -n server "(find [dir_list] -print \
        | cpio -o -c -B 2>/dev/null )" \
        | dd of=/dev/rmt/0 bs=5k

thus avoiding the serach on wrong directories, and the error
processing, maybe you should add a file existence checking
before the cpio with an:  xargs if [-f $1] ....
or something similar, depending on your shell...
0
 

Author Comment

by:bzimmermann
ID: 2007669
change cpio ... 2>/dev/null
into   cpio ... 2>/tmpfile_on_remote_host
to get the error message of the cpio
(in this case a broken pipe)
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Java performance on Solaris - Managing CPUs There are various resource controls in operating system which directly/indirectly influence the performance of application. one of the most important resource controls is "CPU".   In a multithreaded…
Every server (virtual or physical) needs a console: and the console can be provided through hardware directly connected, software for remote connections, local connections, through a KVM, etc. This document explains the different types of consol…
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.:
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

706 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

12 Experts available now in Live!

Get 1:1 Help Now