Git Product home page Git Product logo

autoannex's Introduction

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.

autoannex's People

Contributors

hypoactiv avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.