Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 29 Dec 2008 14:35:06 -0800
From:      Noah <admin2@enabled.com>
To:        User Questions <freebsd-questions@freebsd.org>
Subject:   restart rsync process via shell script
Message-ID:  <4959509A.2060506@enabled.com>

next in thread | raw e-mail | index | archive | help
Hi there,

I am trying to figure out the most accurate way to assess if an rsync
process is running and is established to the remote rsync server and is
transferring data.  I am writing a bourne shell script to restart rsync
if the connection to the remote rsync server is lost.

The command "ps ax | grep 'rsync' | grep -v grep"  is not enough because
the rsync and ssh process can be running but the connection to the
remote server is no longer ESTABLISHED and the backup is no longer
proceeding.

Then perhaps the command "netstat -A | grep '192.168.1.10' | grep
'ESTABLISHED' | grep -v grep" would be helpful.  But in some cases I
have found that I have ssh connections to the remote rsync server that
obfuscate the rsync ssh ESTABLISH statistics.

the rsync command I am using is: "/usr/bin/rsync -avz '/Users/noah/' -e
'ssh -p 22' root@192.168.1.10:/Users"

Any suggestions please?

Cheers,

Noah




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4959509A.2060506>