Quick question: I want to create a repository on my removable USB drive that will acquire all files (eg. "full backup" repository group), but where the files will be visible and usable if you load the drive on another computer.
How do I do that from within the assistant?
Thanks,
Zellyn
This is not something the assistant really handles yet. The issue is that if you have a non-bare repository on the USB drive, something has to run
git annex sync
in it when changes are pushed to it, to update it to display the files that are in the repository.One way to do this is to set up a non-bare repository by hand and add a git post-receive hook that runs
git annex sync
Update: Another way, recently added is https://git-annex.branchable.com/making_a_remote_repo_update_when_changes_are_pushed_to_it/ This new approach even supports FAT filesystems!
git annex sync
command. Thanks!I just tried setting up a post-receive hook with just "git annex sync" in it. The end result is that files (git annex symlinks, really) are getting removed somehow as a result after a couple of git annex sync's done manually. It would be nice if this actually worked.
Seems to me that any such problems would be caused by the environment variables git sets in the hook, or possibly the current working directory in use when the hook runs. So it might take some finessing to get right.
Meanwhile, I've committed a change that makes
git annex merge
merge in changes synced to the repo from other repositories. So that can be used the same waygit annex sync
can, but without the added overhead of committing, pushing, and pulling.You can set it up that way, but the often confusing behavior (including not being able to umount a drive that has the git-annex assistant deamon running in it!) is why the webapp attempt to steer users toward making bare reposotories on USB drives.
If you click on "Add another repository" -> "Removable drive", you get a bare repository.
If you click on upper-right menu -> "Add another local repository" and enter a path, and tell it to combine the repositories, you get a synced non-bare repository, and potentially problems unmounting the drive since you now have 2 assistant daemons running.
I have now added a further link to the nice removable drive path to that second UI path.
Thanks for the explanation, Joey. I just posted a comment about this on the bug report too. Maybe the problem is simply that the Removable Drive option doesn't allow using internal, non-removable drives.
BTW, I don't know if this is relevant, but I only see one "git-annex assistant" process running.
Hi Joey,
I tried to solve this use case with a post-receive hook and had to realize that FAT does not support the executable bit and thus the hook doesn't run. I've found several requests for the use case described here and I think it would be desirable, if the assistant/webapp could solve it without commandline-hacks.
So I want to stick my thumbdrive in my work desktop and the assistant notices that it's available and starts copying stuff on it and runs git annex merge afterwards.
I also had to manually set annex.diskreserve to a smaller value since annex wants to reserve more space (10G) than is available on most thumb drives. I think git-annex init should be more clever about the default diskreserve value, e.g. set it to a percentage of the total disk size.