You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Andreas Jellinghaus <aj...@ciphirelabs.com> on 2005/09/26 10:12:58 UTC

remote svn dump?

Hi,

I tried a poor mans backup:
#!/bin/sh

Y=`svnlook youngest test`
svnadmin dump -r $Y http://www.opensc.org/svn/test \
          |svnadmin load test

that doesn't work, svnadmin dump only works on local directories.
is there any alternative that works on remote repositories?

note: svn mirror doesn't work for me either:
 - it creates bdb repositories
 - it does something strange with the path, right?
 - I tried like this:
#!/usr/bin/perl -w

use strict;
use SVN::Mirror;

my $ru = "http://www.opensc.org/svn";
my $lr = "/home/aj/mirror";

chdir $lr or die "can't cd to $lr: $!\n";

foreach my $r ("test") {
        my $m = SVN::Mirror->new(source => "$ru/$r/",
                        repos => "$lr/$r/",
                        target_path => "",
                        repos_create => 0
                        );
        $m->run;
}

but
Can't call method "path" without a package or object reference 
at /usr/share/perl5/SVN/Mirror.pm line 85.

so it doesn't seem to work for me either.

I want a 100% copy of the remote server, so in case that
machine crashes I have a backup. I'd prefer to do that
over http a lot. I know that a dump will not include
hooks and config files etc, but those are fine, my regular
backup not done often enough will include those.

so do you know a svn dump utility for http://?
or any other suggestion for a simple backup of
a public remote http repository?

Thanks, Andreas

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: remote svn dump?

Posted by Andreas Jellinghaus <aj...@ciphirelabs.com>.
Hi Garrett,

but what about the path mangeling?
I can't create a real mirror with SVN::Mirror, right?
It will add special properties, and move files to a
subdirectory?

I'd prefer if I could realy mirror the content, so
that I can use a dump/load to restore it, in case
the primary server dies.

Anyway, thanks for catching the bug, will see if
it works now.

Regards, Andreas

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: remote svn dump?

Posted by Garrett Rooney <ro...@electricjellyfish.net>.
On 9/26/05, Andreas Jellinghaus <aj...@ciphirelabs.com> wrote:

SVN::Mirror should be able to do what you want.

> note: svn mirror doesn't work for me either:
>  - it creates bdb repositories
>  - it does something strange with the path, right?
>  - I tried like this:
> #!/usr/bin/perl -w
>
> use strict;
> use SVN::Mirror;
>
> my $ru = "http://www.opensc.org/svn";
> my $lr = "/home/aj/mirror";
>
> chdir $lr or die "can't cd to $lr: $!\n";
>
> foreach my $r ("test") {
>         my $m = SVN::Mirror->new(source => "$ru/$r/",
>                         repos => "$lr/$r/",

Try making that 'repospath', not 'repos' and see if it works.  The
documentation for SVN::Mirror is pretty poor in this case, but
according to my reading of the code that should work.

-garrett

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org


Re: remote svn dump?

Posted by kf...@collab.net.
Andreas Jellinghaus <aj...@ciphirelabs.com> writes:
> On Monday 26 September 2005 14:58, Ryan Schmidt wrote:
> > But you probably don't want your dump available publicly.
> 
> I'm sorry: why? If the repository is public available, is
> there anything in the dump that isn't available by other means, too?

For speed and simplicity of code, 'svnadmin dump' does no
authorization checks -- it just assumes you're allowed to read
everything in the repository (since you clearly have read access to
the physical filesystem, this is a safe assumption).  A dump over one
of the network protocols could not make this assumption, however.

> I really liked the idea of doing it pull-based, using anonymous http.
> would be nice if I could do that somehow.

For the above reasons, it could never be anonymous.

-Karl

-- 
www.collab.net  <>  CollabNet  |  Distributed Development On Demand

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: remote svn dump?

Posted by Branko Čibej <br...@xbc.nu>.
Ryan Schmidt wrote:

>> I really liked the idea of doing it pull-based, using anonymous http.
>> would be nice if I could do that somehow.
>
>
> You can certainly write a wrapper script in a language of your choice  
> (PHP, Perl, Python, Ruby, etc.) which is accessible via HTTP and  
> whose job it is to start the dump and send back the result.

I thought Perl's SVN::Push was supposed to know how to do that?

-- Brane


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: remote svn dump?

Posted by Ryan Schmidt <su...@ryandesign.com>.
On Sep 26, 2005, at 15:10, Andreas Jellinghaus wrote:

> On Monday 26 September 2005 14:58, Ryan Schmidt wrote:
>
>> But you probably don't want your dump available publicly.
>
> I'm sorry: why? If the repository is public available, is
> there anything in the dump that isn't available by other means, too?

I didn't realize you were talking about a publicly-available  
repository. Then I suppose there's no problem.


>> But you probably also don't want to
>> send the same data over and over again—the dump won't change so much
>> from day to day.
>
> well the script I had was looking at the youngest revision and thus
> would only dump and load updates, so if it worked, there wouldn't
> be a problem.

True.


> I really liked the idea of doing it pull-based, using anonymous http.
> would be nice if I could do that somehow.

You can certainly write a wrapper script in a language of your choice  
(PHP, Perl, Python, Ruby, etc.) which is accessible via HTTP and  
whose job it is to start the dump and send back the result.



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org


Re: remote svn dump?

Posted by Andreas Jellinghaus <aj...@ciphirelabs.com>.
On Monday 26 September 2005 14:58, Ryan Schmidt wrote:
> But you probably don't want your dump available publicly.

I'm sorry: why? If the repository is public available, is
there anything in the dump that isn't available by other means, too?

> But you probably also don't want to
> send the same data over and over again—the dump won't change so much
> from day to day.

well the script I had was looking at the youngest revision and thus
would only dump and load updates, so if it worked, there wouldn't
be a problem.

I really liked the idea of doing it pull-based, using anonymous http.
would be nice if I could do that somehow.

Regards, Andreas

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org


Re: remote svn dump?

Posted by Ryan Schmidt <su...@ryandesign.com>.
On Sep 26, 2005, at 12:12, Andreas Jellinghaus wrote:

> Y=`svnlook youngest test`
> svnadmin dump -r $Y http://www.opensc.org/svn/test \
>           |svnadmin load test
>
> that doesn't work, svnadmin dump only works on local directories.
> is there any alternative that works on remote repositories?

[snip]

> so do you know a svn dump utility for http://?
> or any other suggestion for a simple backup of
> a public remote http repository?

svnadmin intentionally works only on local repositories.

You can use svnadmin locally to create a dump, and then put the dump  
in a location where it's accessible by the web server, then access it  
remotely.

But you probably don't want your dump available publicly. You could  
protect it with a password... But you probably also don't want to  
send the same data over and over again—the dump won't change so much  
from day to day. So something like rsync, which only transmits the  
differences, would probably be more efficient.



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org