Hi,

I'm setting up monitoring hourly commits on several repositories and thought 
something like this would work:

#!/bin/sh
OneHourAgo=`date -d '1 hour ago' +'%F %T'`
DateNow=`date +'%F %T'`
em_result=`svn log -r "{${OneHourAgo}}:{${DateNow}}" file:///${SvnBase}/${1} | 
egrep "^r.*line|^r.*lines"$ | wc -l`

There likely is an easier or more accurate way to do this but the above will 
always report a value of 1 even when the HEAD revision does not fall within the 
specified date as shown below.

svn log -r "{2010-03-10 11:42:20}:{2010-03-10 12:42:20}" 
file:///misc_sourcectrl01/svnrepositories/svnrepos1
------------------------------------------------------------------------
r12138 | user | 2009-07-09 07:41:21 -0700 (Thu, 09 Jul 2009) | 1 line

add the source
------------------------------------------------------------------------

It's not a big deal but it does make unused repositories look like there is 
some activity.  Any ideas on a better way to do this or why the command always 
returns the HEAD revision?

Thanks for any help with this,

Kevin


      

Reply via email to