[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: post-commit hook fails

From: Bob Proulx <bob_at_proulx.com>
Date: 2006-03-10 01:06:08 CET

Alien8 Recordings wrote:
> I am trying to do execute the following simple post-commit script:
>
> ---------
> #!/bin/bash
>
> REPOS="$1"
> REV="$2"
> /usr/bin/svnadmin dump /var/svn --revision $REV --incremental > /
> backup/svn_backups/dump$REV &> /tmp/postout.txt

You make a typo. The & puts the command in the background and the >
redirects the next command to the output file. I think you wanted
"2>" here. No need for >& to do synchronous updates since this is a
different file from fd 1.

  s/&>/2>/

  /usr/bin/svnadmin dump /var/svn --revision $REV --incremental > /backup/svn_backups/dump$REV 2> /tmp/postout.txt

> ... but when I commit nothing seems to happen. The stdout/err file
> is never written. Does anyone have any suggestion about how I could
> solve this problem? Am I missing something?

Easier to redirect all output to a file for all commands. See the
additional 'exec' line below for an example.

  #!/bin/bash
  exec >/tmp/post-commit.out 2>&1
  REPOS="$1"
  REV="$2"
  /usr/bin/svnadmin dump /var/svn --revision $REV --incremental > /backup/svn_backups/dump$REV

Bob

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Fri Mar 10 01:07:56 2006

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.