Hi, I'm new to git annex and so far it's looking really useful. I'm convinced what I'm trying to achieve is possible, but I can't seem to hit upon the right combination. Here's what I'd like to set up.
One server with git annex / rsync / ssh access, but configured such that it contains a history of all the files as a full backup. Two clients WITHOUT ssh access (these are portable machines and I'd rather not open any ports I don't absolutely have to).
I've used the assistant to set up syncing between all three, using a jabber account to send signals and the server to pass on the files between the machines. This all works beautifully. But what I can't seem to get right is the server / backup aspect. If I set up the server using the assistant as a remote, and set it to "full backup" from the drop down list, it doesn't seem to have any files in the repository except in the .git/annex/objects folder. Which are all cryptic file names and not really accessible. If I run commands such as
git annex find
(which should list all files as far as I can tell) in the server repository, it doesn't list any files at all. As the clients are all set up as direct repositories I can't access any history of the files there, so this doesn't seem to be quite what I'm after. The sync is working, but I really want the backup / history aspect as well.
Does anyone know if what I want is possible? If so hopefully I'm close and someone can point out where I've gone wrong. I'm not afraid of the command line, but the assistant is a very convenient way to get started.
Thanks for your help.
Hi,
When setting up a ssh remote the default is to create a repo without a human readable file structure. To achieve what you are looking for you have to initialize a git annex repo on the server and then add the remote to the clients. afaik this has to be done using the command line interface.
If i remember correctly you add remotes with
git remote add ssh://example.com/path/to/annex
Cant find the docs atm (I'm commuting and at my final dest)
OK that sounds reasonable. I'll give it a go.
I don't mind so much that the remote is not human readable as I wont be browsing directly on the remote, but what I did find disconcerting is that I didn't seem to be able to access any files. For example if I lose both the client machines, how do I get access to the files on the remote?
On the server I ran
git init git annex init
On client I ran
git init git annex init git annex direct
then dropped some files in and ran
git sync
This didn't upload any files. I now have a broken link on the server without the actual file.
When I tried to set up the server in the same way, then used the web assistant to create the repository on the client and then combine it with the manually created repository on the server, it actually worked for the first file. I could see a working link to the file it had just uploaded. But any subsequent files didn't reflect in the file structure. Additional files would show up in the .git/annex/objects folder, but again I have no way to explore these. git annex find showed nothing, git annex status showed only the first file and git log didn't show much. I tried re-adding this remote to a new annex repository, but it didn't give me access to the files or the history of the files. I'm confused!
Is it me or is this not working as expected?
If you don't need human readable file structure on the server you don't have to initialize the annex repo. Just create a "remote server" repo with the assistant and set it to "full backup" if you want all the files there all the time. Without the "full backup" setting I believe only files it thinks someone else needs will be uploaded.* This might solve your problem with symlinks as
git annex sync
syncs metadata, only moving actual data if required.I'm not sure if the
git-annex find
command will work on a bare repo I can't test as all my repos are configured so that I can access the files in a normal way. Runninggit-annex whereis $file
on the client should allow you to check if a file has been uploaded.*Massive caveat as I'm really not sure