Using rsync to mirror a hard drive.

Dave Dykstra dwd at
Tue Oct 23 02:12:41 EST 2001

On Mon, Oct 22, 2001 at 01:18:47AM +0000, Thaddeus L. Olczyk wrote:
> 5) I need to know if rsync fails. It is useless to me if it fails 
> and then fails to notify me. The man pages fail to totally describe
> return values, but I assume that they do describe success/failure.
> So I wrote a script to test this out.
> #!/bin/sh
> export res=$(rsync -avv / /mirror)
> echo $(res)

I don't understand that syntax.  /bin/sh for me reports
    syntax error: `(' unexpected
Under ksh I would expect that to be equivalent $(...) to be equivalent
to `...` but then what would echo `res` mean?

> I then mounted a partition of 15M on /mirror, and executed the script
> to get an idea of how rsync behaved when it ran out space.
> rsync seems to hang in the middle of /etc .
> df shows that only 75% of /mirror is filled/
> Any idea why rsync hangs.

Perhaps it's a problem with your script?

> 6) I'm a bit confused by the notation for rsync excludes. I would like
> to exclude certain things and seem to be failing. I would like to
> exclude things such as ( matching by grep ) "^/proc" "^/mirror"
> "^/tmp". Of course the ^ in front indicates that I do not want  to
> exclude things like /home/olczyk/mirror.

Rsync excludes are not as powerful as regular expressions.  However, if
you start them with a slash, they match only the beginning of a path.
So you should be able to just say "/proc", "/mirror", "/tmp", etc.

- Dave Dykstra

More information about the rsync mailing list