savannah-hackers-public
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Savannah-hackers-public] Savannah recovery TODO


From: Sylvain Beucler
Subject: Re: [Savannah-hackers-public] Savannah recovery TODO
Date: Fri, 5 Jun 2009 20:05:05 +0200
User-agent: Mutt/1.5.18 (2008-05-17)

On Fri, Jun 05, 2009 at 09:05:50AM +0200, Sylvain Beucler wrote:
> On Fri, Jun 05, 2009 at 01:21:26AM +0300, Sergey Poznyakoff wrote:
> > Sylvain Beucler <address@hidden> ha escrit:
> > 
> > > Do you think you could improve the script so it can compare 2
> > > hierarchies (e.g. /srv/git/*/* and
> > > /srv/git/backup/backup-20090527/*/*) and get the ones who are more
> > > recent in the backup?
> > 
> > Sure, I can. So, the script shall select the most recent repo and copy
> > it to /srv/whatever at once, right?
> 
> I think it's better that the script stays 'read-only' and outputs the
> name of the repositories to replace. We can shutdown the service for 2
> minutes.

Based on reading your code I'm running the following, should be good:

for i in *.git */*.git; do ts1=$(GIT_DIR=$i git rev-list --max-count=1 
--timestamp --all 2>/dev/null | awk '{print $1}'); 
ts2=$(GIT_DIR=backup/backup-20090527/$i git rev-list --max-count=1 --timestamp 
--all 2>/dev/null | awk '{print $1}'); ts1=${ts1:-0}; ts2=${ts2:-0}; if [ 
"$ts2" -gt "$ts1" ]; then echo $i $ts1 $ts2; fi; done

Just need to exclude cvs2git repos.

-- 
Sylvain




reply via email to

[Prev in Thread] Current Thread [Next in Thread]