autoannex

command module
v0.0.0-...-51a858e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 15, 2017 License: GPL-3.0 Imports: 14 Imported by: 0

README

Description

autoannex is a simple tool for automating the use of git-annex repositories. Among other things, it eases the discovery of repositories on external media or other computers that may not always be present. Once the repositories are discovered, git-annex commands such as git annex sync and git annex get --auto can be run on each repository automatically.

Usage

First configure your Go environment, and then install autoannex.

$ go get github.com/hypoactiv/autoannex

If you haven't already, create a git-annex repository.

$ mkdir ~/test
$ cd ~/test
$ git init
$ git annex init

Create a signature file, and add it to the repository.

$ autoannex sig new .
$ git add .signature
$ git commit -m "initial commit"

Verify that autoannex can find the repository. Note that your repository UUID will be different, as they are randomly generated.

$ autoannex sig find
2c20fe8d-0768-4050-6a3b-e180c5f12b25:
- /home/user/test

Clone the repository

$ cd ~
$ git clone ~/test test2

You can now use autoannex to discover the two repositories, add them as remotes for each other, and sync them.

$ autoannex sync $(cat ~/test/.signature)
Found repository group 2c20fe8d-0768-4050-6a3b-e180c5f12b25 with 2 members
Now syncing /home/user/test ...
Done. Took 2s
Now syncing /home/user/test2 ...
Done. Took 2s    

autoannex can also use SSH to connect to remote machines and look for members of the specified repository groups. Note that autoannex must be installed on the target hosts and accessible in $PATH for this to function.

$ autoannex sync $(cat ~/test/.signature) --ssh-hosts=hostA,hostB

You can also run git-annex fsck, git-annex add, and git-annex get, as well as arbitrary git commands. Run autoannex --help to see full usage.

How are the repositories discovered?

autoannex uses files containing a UUID to mark and later discover repository locations throughout the system. By default, all mount points (via /proc/mounts) and the user's home directory are searched recursively to a maximum depth of one. The maximum search depth can be modified to find repositories located deeper in the filesytem.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
Searches the system for matching groups of directories, based on a signature file placed in the directories containing a UUID
Searches the system for matching groups of directories, based on a signature file placed in the directories containing a UUID
A very incomplete package for communicating with git-annex from Go
A very incomplete package for communicating with git-annex from Go

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL