Hotback of Git Server Using RSync?

安稳与你 提交于 2019-12-25 07:14:04

问题


I'm wondering if it is safe to use rsync to hotbackup a git server (The /home/git folder containing multiple repositories).

I'm assuming that this could introduce race conditions, but perhaps git commit is an atomic operation such that rsync either sees the files as they are before the commit or after the commit but not somewhere inbetween.

I'll provide an example as well just to make sure I'm illustrating this properly. Suppose file A and file B are being committed to one of the repositories. Rsync will either back them both up prior to the commit or after the commit. But will not backup file A before the commit, and then file B after the commit.

If using RSync is not safe an alternative would be to run a script that clones each repository to the backup server.

So for the entire server directory: 1) cd into the account 2) clone all repositories 3) cd into next account 4) clone all repositories 5) and so on...

But rsync is a lot simpler so I'm crossing my fingers :). If anyone has an even simpler option I would love to hear about that as well.

TIA, Ole

来源:https://stackoverflow.com/questions/36946527/hotback-of-git-server-using-rsync

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!