Announcement

Collapse
No announcement yet.

post-commit et svnsync

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • post-commit et svnsync

    Hey,

    I'm trying to do a replication between 2 svn servers,

    To do a live replication I want to use a hook and a post-commit script

    I have write the post-commit script on the "master" server like this :

    Code:
    #!/bin/sh
    svnsync --non-interactive sync http://URL/REPO &
    but the replication to the server "slave" doesn't work and I have no log of why it doesn't work.

    and if I test the command svnsync --non-interactive sync http://URL/REPO in the shell of my "master" server it works

    So I don't understand why it doesn't work maybe you could help me

    thanks

  • #2
    Hi,
    within hooks you don't have any enverinment so no path at all...so you should give the absolute path to svnsync ...

    And why don't you do the replication based on a time scheduled based instead...would be simpler...

    Kind regards
    Karl Heinz Marbaise

    Comment


    • #3
      thanks for your response,
      I don't see how to do a replication based on a time scheduled and I think that I prefer to do replication just after a commit except if there is problems to do like this.

      I don't understand also why the command line works in the shell but doesn't in the post-commit file... I precise that I want to use /bin/sh in the bang.

      When you say I should give the absolute path you that I should give for example if I try to commit the file test.c in the repos test_repos I should specify as path : http://URL_TO_REPO_SLAVE/test_repo/test.c ? But I can't do that for each file. Is there here that I should use the variable $1 or $2 as I have seen in the post-commit example file ? (I didn't really understand how to use those variable)

      thanks again for your help

      Comment


      • #4
        Hi,
        i didn't mean you should give the absolute path of the repository..you should give the path to svnsync instead...

        Code:
        /usr/local/bin/svnsync ...
        ...

        I don't see how to do a replication based on a time scheduled and I think that I prefer to do replication just after a commit except if there is problems to do like this.
        You could do via cron e.g....but if you prever to do it every commit it's fine...

        Kind regards
        Karl Heinz Marbaise

        Comment


        • #5
          ok thanks I misunderstood
          I will test that right now

          About scheduled replication or live replication I asked me if maybe there could have a problem if I do live replication in case of huge file commtting or a lot of commit at the same time

          Comment


          • #6
            it doesn't work yet I should a configuration problem on my slave server

            when I try to commit with tortoiseSVN I got this error :

            'post-commit' hook failed with error output:

            (no more indication)

            so I try the command line directly in the shell and I got more indication I think I could resolve this now (hope that )

            Comment

            Working...
            X