[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [hobbit] Using ssh to retrieve hobbit data
- To: hobbit (at) hswn.dk
- Subject: Re: [hobbit] Using ssh to retrieve hobbit data
- From: Ralph Mitchell <ralphmitchell (at) gmail.com>
- Date: Wed, 4 Jan 2006 06:11:12 -0600
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=G5CBpLbxCA/u/rCJYHQbyrwqM7A6aiWWEbOS/DKCXe2wC8sH1adOwKh96AKl1Es4sk6JSpf3MNg9FKjbgPLRHULQPTrFbCDl4QWHvsjeH4lqhwYXn78K+iH68PH7PIzfN/f8GKmHwpcfbMJXuI/fQFGrfTiJlh8BYnxTe+8kd0Q=
- References: <1135893113.19814.ezmlm@hswn.dk> <OFE1FD9753.265E2B26-ON852570EB.006B76E8-852570EB.006BC82B@glic.com> <20060104111556.GA30558@hswn.dk>
On 1/4/06, Henrik Stoerner <henrik (at) hswn.dk> wrote:
> [snip]
>
> This is a rough solution. It doesn't deal with scp taking a loooooong
> time to login or timeout if your client is down; it doesn't delete the
> client-side status message, so if you client stops running you won't
> notice it going purple. But it should give you an idea of how it can
> be done, and it would work for the common case.
bb-fetch.sh doesn't delete the client-side status message either. It
keeps the old copy and diffs the new copy against it. If there's no
difference, the client-side isn't updating. So, your rough solution
would become something along the lines of:
# Save the old statusfile and get the new one
mv $HOSTNAME.$MSGFILE $HOSTNAME.$MSGFILE.old
scp hobbit (at) $HOSTNAME:client/tmp/msg.txt $HOSTNAME.$MSGFILE
if [ -f $HOSTNAME.$MSGFILE.old ]; then
changed=`$DIFF $HOSTNAME.$MSGFILE $HOSTNAME.$MSGFILE.old`
else
changed="new"
fi
if [ "$changed" = "" ]; then
# report that the client isn't updating
fi
Perhaps scp options ConnectionAttempts & ConnectTimeout would help
deal with the long login timeout??
Ralph Mitchell