Hook Script For Repository Backup

ggp
ggp
Hi All, I am new to Subversion. Can any one tell me how to write a post commit hook script for taking backup of repository?

Last updated

andyl
andyl
Is your server so unstable that you need to take a backup after every commit?
ggp
ggp
Hey it is not the case. I just wanted to know how to take the backup of repository. As i read in subversion book, u have to write hook script for it. So just wanted to know how to write it ?
andyl
andyl
I can't think of a good reason to use hook scripts to perform a backup, and I'd be surprised if the book actually recommended that (can you provide a link?). Perhaps you misunderstood? I have a script that I wrote scheduled nightly to run svnadmin hotcopy to make a backup copy of my repositories. There's also a hotcopy.py (I'm sure I have the name wrong, but it's close) that comes with subversion which is more sophisticated than my script. But taking a backup copy after every commit seems like a huge waste of time and resources.
lovedaddy
lovedaddy
mine This is what I did to have an incremental backup done (can be run from cron on an evening etc) [url]http://www.svnforum.org/2017/viewtopic.php?t=183&highlight=backup[/url]
angie
angie
incremental backup [quote=andyl]I can't think of a good reason to use hook scripts to perform a backup, and I'd be surprised if the book actually recommended that (can you provide a link?). Perhaps you misunderstood? I have a script that I wrote scheduled nightly to run svnadmin hotcopy to make a backup copy of my repositories. There's also a hotcopy.py (I'm sure I have the name wrong, but it's close) that comes with subversion which is more sophisticated than my script. But taking a backup copy after every commit seems like a huge waste of time and resources.[/quote] Very interesting point of view. I use incremental backup with the post-commit hook: REPOS="$1" REV="$2" /usr/local/subversion/bin/svnadmin dump "$REPOS" --revision "$REV" --incremental >> "/path/to/incremental/backupfile" I don't see why this is a huge waste of space and resources, the resulting dumpfile can be part of any backup strategy. Case of a server failure I can setup a whole new server and load the file into a new repos. me thinks that cool. greetings

1-6 of 6

Reply to this discussion

You cannot edit posts or make replies: You should be logged in before you can post.

Post a reply
9002 views