Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mercurial Backup

How could I enable automatic (incremental) backups of a Mercurial (central/main) repository?

I'm coming from subversion where I was able to make a commit-hook that uploaded changes to S3.

Edit: If this sort of strategy doesn't make sense for Mercurial, what backup strategy would make sense?

like image 411
Adam Tegen Avatar asked Mar 23 '10 14:03

Adam Tegen


1 Answers

The beauty of how simply the DVCS's store history is that you can do this in a million different ways. You could write a commit hook, but I found it easier to just do it manual push + cron.

My simple and most likely naive approach:

I push to my central repository. My backup server pulls from the central repository every 10 minutes. Every day at 2:30am the central repository gets gzip'd and downloaded to the backup server. When I boot up my local machine I download the latest gzip backup and if I cared enough I could burn those to a CD.

So at any given moment I have at least 3 fairly recent backups and 3 recent working copies stored at different locations around the continent. If all of these fail I will be more worried about the rise of skynet then that I lost my project.

like image 152
mfperzel Avatar answered Sep 29 '22 19:09

mfperzel