Backup SVN repository

walden systems, geeks corner, programming, languages, developer, redmine, backup, shell, unix, bash, ksh, svn, rsync, gzip, respository, svn, subversion
Shells read input up to an unquoted newline and then execute it. An unquoted backslash followed by a newline are discarded and cause the shell to wait for more input. The backslash and newline are discarded before the shell tokenizes the string, so long lines can be split anywhere outside of single quotes, even in the middle of command names and variable names.

Sometimes you might need to backup your SVN repository. There are many ways to accomplish this task and I would like to discuss one of the ways we are using here at Walden Systems, because we believe this is the most straightforward method to backup a SVN repository.

Strategy to backing up SVN repository is fairly simple: Run a svn dump and pipe it to a gzipped file

Here is actual code samples:
You need to run the svn dump utility as such:

   svnadmin dump /PATH/TO/SVN/REPOSITORY

Pipe it to gzip:

   | gzip -9 


Finally, you redirect gzip output to a gzipped file:

    > /PATH/TO/SVN/BACKUP/DIR




So, this is how a final code for backing up a SVN repository will look like:

   svnadmin dump /PATH/TO/SVN/REPOSITORY | gzip -9 > /PATH/TO/SVN/BACKUP/DIR