Been using Unison for a while to sync a folder at three different computers (can be on or off simultanously). However, I've for different reasons been looking for a different solution. Here comes git annex.e
I started out with one computer, generated a new repo locally and at the server (a synology nas) with the assistant. Then i put all my files into the local directory and the files uploaded to the server. All good. I put the local computer in client mode and the server in backup mode. Then i configured a second computer with an empty repo folder, was asked to join repos, did that. Also put this computer in client mode and the server in backup. After a while all the files was located in the second computers repo directory. Yes, I was confident this was the way to go.
Howewer, doing the same with my laptop was not successful at all. After similar setup as above it only downloaded about 5% of the data. Bummer. While I tried to study the logs I thought I should check the second computers repo. That was modified and a lot of files where gone. Wow...of course I have backup, but I was hoping for a proper and consistent operation.
So what causes this? Should I not put the server in backup mode? Anyone have an idea?
Other thoughts?
Okey, came in to the office today to check the first computer I set up. It lacks all the files except the ones located on the third computer. So all sites are synced (only a lot of files are dropped). Seems something happened while the third computer was set up that caused just a few files to sync from the backup server and then git somehow thought that was it and then synced computer one, two and the server according to files present on computer three (obviously way to few files). This is slightly worrisome and I wonder what caused this. I'll inspect the log files for the transfer on computer three when I get home.
Can anyone of you confirm that having this setup should not cause problems:
computer 1 - client mode computer 2 - client mode computer 3 - client mode backup unit/nas - backup mode
Finally had some time today to lock at the logs. However, I started from scratch. Created a local repo with the assistant, transferred some real files into the local repo dir (not .git of course). Waiting until everything was added etc. Then I created the remote server repo and it immediately started to transfer files from the local repo to the remote. Then I was slightly surprised when I got back home and saw this in the logfile:
----- cut -----
somefile
[new branch] annex/direct/master -> synced/master error: Ref refs/heads/synced/git-annex is at 112bb35566a0ee9434fb74524cdced45792bf8ed but expected 0000000000000000000000000000000000000000 error: Ref refs/heads/synced/master is at d593f3c3a5090009789154bd60c3390d9a1b90d6 but expected 0000000000000000000000000000000000000000 remote: error: failed to lock refs/heads/synced/git-annex
remote: error: failed to lock refs/heads/synced/master
To ssh://someserverrepodir ! [remote rejected] git-annex -> synced/git-annex (failed to lock) ! [remote rejected] annex/direct/master -> synced/master (failed to lock) error: failed to push some refs to 'ssh://someserverrepodir'
fatal: 'someserverrepodescription' does not appear to be a git repository fatal: Could not read from remote repository.
Please make sure you have the correct access rights and the repository exists. fatal: 'someserverrepodescription' does not appear to be a git repository fatal: Could not read from remote repository.
Please make sure you have the correct access rights and the repository exists. fatal: 'someserverrepodescription' does not appear to be a git repository fatal: Could not read from remote repository.
Please make sure you have the correct access rights and the repository exists. [2014-10-13 21:58:05 CEST] Transferrer: Uploaded somefile
----- cut -----
This was a total surprise to me. If this was the stuff that made the previous setup fail, I don not know, but I will try to track down this error first. I would be quite surprised if it indeed was a permission issue. Also visible is an upload session for one of the files...that seems to go on fine and is probably not related to the error at all. This was the only error printed once during the entire transfer/sync process. Thought the first thing I would check was the size and number of files in the local and remote directory, but I'm not really sure how to do this with all the git stuff around on the remote. Typically "git ls-files | wc -l" or similar gets me going on the local repo. How would I do this on the remote (in backup mode if that counts)?