Coder Social home page Coder Social logo

qusong520 / confsyncer Goto Github PK

View Code? Open in Web Editor NEW

This project forked from kur-archive/confsyncer

0.0 0.0 0.0 110 KB

[WIP]A little sync config files tool in the Linux.

License: GNU General Public License v3.0

Go 95.60% Dockerfile 3.38% Makefile 0.81% Shell 0.20%

confsyncer's Introduction

confsyncer

A little sync files tool in the Linux.

What's this

confsyncer is a little tool about push and pull files in git repo, 基于此 你可以 很方便的将一些配置文件在 多台机器中进行同步.

Features

  • 手动 Push 监视中的 文件到指定的 git 仓库
  • 自动/手动 从指定的 git 仓库 拉取文件到本地的指定位置

Install

$ wget xxxxxx

or

# use docker-compose with "gen"
$ wget xxxxxx
$ cp xxxxx
$ gen xxxx

How to Use

In Host

  1. init confsyncer's config

    # init confsyncer's config
    $ confsyncer init
    init confsyncer's configfile in ~/.confsyncer/config.yaml
    
    This is your config: 
    {
        "gitpulltimeinternal": 30,
        "maps": [
            {
                "src": "// TODO SourceFilePathOfGitRepo",
                "dist": "// TODO FilePathOfLocal"
            }
        ],
        "gitrepo": "[email protected]:examples/examples.git"
    }
    
    you should modify it before use.
  2. modify confsyncer

  3. create the git repo and push your config files to repo

    # show confsyncer's config
    $ confsyncer config
    xxxxxx
    
    # commit && push files to git repo
    $ confsyncer push
    /tmp/a->/tmp/b job success
    /tmp/c->/tmp/d job success
    /tmp/e->/tmp/f job failed
  4. modify crontab file to pull config every 1m

    # 
    * * * * * bash -c "confsyncer pull"
  5. 或者你也可以手动的拉取

    # pull config files
    $ confsyncer pull
    /tmp/a->/tmp/b job success
    /tmp/c->/tmp/d job success
    /tmp/e->/tmp/f job failed

In Container

  1. init confsyncer's config

    # init confsyncer's config
    $ confsyncer init
    init confsyncer's configfile in ~/.confsyncer/config.yaml
    
    This is your config: 
    {
        "gitpulltimeinternal": 30,
        "maps": [
            {
                "src": "// TODO SourceFilePathOfGitRepo",
                "dist": "// TODO FilePathOfLocal"
            }
        ],
        "gitrepo": "[email protected]:examples/examples.git"
    }
    you should modify it before use.
  2. modify confsyncer

  3. run confsyncer-gen with you confsyncer config

    # 
    $ confsyncer-gen -f ~/.confsyncer/config.yaml -o ./
    # 然后使用 docker-compose 启动服务即可 , 重新生成后也是一样的操作和结果
    $ docker-compose up -d

docker-compose.yaml Gen

// TODO docs

LICENSE

GPL-3.0

confsyncer's People

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.