Using rsync to mirror a hard drive.
Thaddeus L. Olczyk
olczyk at interaccess.com
Mon Oct 22 11:18:47 EST 2001
1) I'm a developer.
2) I use one special machine as a CVS server, generic storage ( an
electronic attic ), as a web server of online documentation ( such as
the python documentation, or SGI STL docs ).
3) I would like to add a hard drive to that system that mirrors the
system drive. Someone suggested that I use rsync for this purpose.
Called by a cron job that starts at 2:00am. I also want to build a
list of changed files to make into a tarball that gets copied to
a remote machine where it gets backed up to tape ( for which I was
told --dryrun would be used).
4) The basic idea as I understand it is to issue a command:
rsync -avv / /mirror.
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.
export res=$(rsync -avv / /mirror)
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.
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.
More information about the rsync