You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Robert Dailey <rc...@gmail.com> on 2008/08/13 16:48:31 UTC
Using python to invoke svnadmin?
Hi,
I want to create a python script that performs an "svnadmin dump" for
backup/archival purposes. I realize I could just use python to invoke a
command, but I wanted to avoid that if possible. Is there a module somewhere
that facilitates an interface into the svnadmin program? I basically need
the python equivalent of "svnadmin dump /my/repo > my_backup". Thanks.
Re: Using python to invoke svnadmin?
Posted by Jeremy Whitlock <jc...@gmail.com>.
> I want to create a python script that performs an "svnadmin dump" for
> backup/archival purposes. I realize I could just use python to invoke a
> command, but I wanted to avoid that if possible. Is there a module somewhere
> that facilitates an interface into the svnadmin program? I basically need
> the python equivalent of "svnadmin dump /my/repo > my_backup". Thanks.
Well, it would be really simple to use the subprocess.call to
"wrapper" an svnadmin call, which would mirror invocation from the
command line basically but within Python. You could also use the
Subversion Python bindings to make direct Subversion API calls to
perform the dump. There is a very good example of doing this in the
Subversion Python bindings tests:
http://svn.collab.net/viewvc/svn/trunk/subversion/bindings/swig/python/tests/repository.py?view=log
I hope this helps.
Take care,
Jeremy
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Re: Using python to invoke svnadmin?
Posted by Robert Dailey <rc...@gmail.com>.
On Wed, Aug 13, 2008 at 12:11 PM, Blair Zajac <bl...@orcaware.com> wrote:
>
> First, if you're not doing anything special with your backup script, then
> just use
>
> http://svn.collab.net/repos/svn/trunk/tools/backup/hot-backup.py.in
>
> which comes with Subversion. It compresses backups, keeps N old ones
> around and is generally the tool people use to backup their repositories.
This is even better! I was thinking I'd have to write this myself! Thank you
so much!
If you need to use your own custom backup and don't want to shell out, then
> use
>
> $ python
> >>> import svn.repos
> >>> svn.repos.dump_fs2
> <function svn_repos_dump_fs2 at 0xf77d66f4>
>
> See svn_repos.h on how to use it.
Re: Using python to invoke svnadmin?
Posted by Blair Zajac <bl...@orcaware.com>.
Robert Dailey wrote:
> Hi,
>
> I want to create a python script that performs an "svnadmin dump" for
> backup/archival purposes. I realize I could just use python to invoke a
> command, but I wanted to avoid that if possible. Is there a module
> somewhere that facilitates an interface into the svnadmin program? I
> basically need the python equivalent of "svnadmin dump /my/repo >
> my_backup". Thanks.
First, if you're not doing anything special with your backup script, then just use
http://svn.collab.net/repos/svn/trunk/tools/backup/hot-backup.py.in
which comes with Subversion. It compresses backups, keeps N old ones around and
is generally the tool people use to backup their repositories.
If you need to use your own custom backup and don't want to shell out, then use
$ python
>>> import svn.repos
>>> svn.repos.dump_fs2
<function svn_repos_dump_fs2 at 0xf77d66f4>
See svn_repos.h on how to use it.
Regards,
Blair
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org