Ever since I started using svn I have found it an indispensable tool. I have created a local repository on my hard disk and all my personal projects are using this repository. And having had lots of hard disk crashes last year, I fear for the loss of my code files. So, I thought about a regular backup system.
I also have Ubuntu installed as a virtual machine. And Ubuntu has this Ubuntu One feature, which gives you a 2gb space online. So I went ahead to backup my repository to this space.
I have my repository mounted in Ubuntu at /mnt/WinRepository. The following script takes a dump of the repository:
svnadmin dump /mnt/WinRepository --incremental > ~/Ubuntu\ One/WinRepo.bak
The advantage of using incremental option is that I can specify revision range to be backed up into different files.
svnadmin dump /mnt/WinRepository --revision 0:100 > ~/Ubuntu\ One/WinRepo1.bak svnadmin dump /mnt/WinRepository --revision 101:200 --incremental > ~/Ubuntu\ One/WinRepo2.bak svnadmin dump /mnt/WinRepository --revision 201:HEAD --incremental > ~/Ubuntu\ One/WinRepo3.bak
And since the files are being saved in Ubuntu One folder, they get automatically backed up to the Ubuntu One online space.
This does not compress the files. But since I have 2 gb of space available, I am not really concerned about space.
Popularity: 9% [?]
Related posts: