I'd like to make a backup of my SVN repo using tar and ftp from a cronjob once a day. This is quite easy, but I would like to make sure there's no commit etc. running while the backup is made. While there are times of the day / night where this is highly unlikely, but I'd rather not rely on that, because if I'm already up at night in some crunch, the last thing I need is my SVN or my backups getting messed up.
I'm looking for some very simple but effective safeguard. It's OK if SVN clients get an error while the backup is running (it won't take that long). Should I use
- something on the filesystem level
- some SVN hook script
- something else entirely
I started posting this over at serverfault, but then decided that it is slightly closer to programming than to sysadmin, especially if hooks are involved. Feel free to move it if you think otherwise.