Tuesday, November 20, 2012

Subversion backup on linux


BACKUP

To make a complete copy of the Subversion repository system just follow these small steps:

- Locate the repository directory, in our case: / var / lib / svn
- Locate the destination directory for the backup, in our case: / tmp /
- Perform a dump of the repository with the following command:

sudo svnadmin dump / var / lib / svn> / tmp / svnbackup.dump

RESTORING BACKUP


After creating a backup to restore, just run the following command:

sudo svnadmin load / var / lib / svn </ tmp / svnbackup.dump
For example, to automate this task attached a small script that can be put in the cron server for convenience when backing up versions of our system:

---- svnbackup.sh ----
#!/bin/sh HORA=$(date +"%Y-%m-%d")
FICHERO="/tmp/svnbackup-$HORA.dump"
REPOSITORIO= /var/lib/svn
svnadmin dump $REPOSITORIO > $FICHERO
---- fin svnbackup.sh ----

No comments:

Post a Comment