Solved

dd / cpio backup problem

Posted on 1997-11-10
2
938 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

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

Title # Comments Views Activity
sed -- search an replace multiple pattern 11 68
Restore XenServer VM with only dd image of LVM snapshot 3 161
Solaris 4.1.3 cloning and booting 13 72
aix unix tar error 3 43
Let's say you need to move the data of a file system from one partition to another. This generally involves dismounting the file system, backing it up to tapes, and restoring it to a new partition. You may also copy the file system from one place to…
My previous tech tip, Installing the Solaris OS From the Flash Archive On a Tape (http://www.experts-exchange.com/articles/OS/Unix/Solaris/Installing-the-Solaris-OS-From-the-Flash-Archive-on-a-Tape.html), discussed installing the Solaris Operating S…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

920 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