Giter VIP home page Giter VIP logo

gitbackup's Introduction

gitbackup

将数据定时增量备份到 git 远程仓库。

使用

假设在 /var/www/data 目录下有 dir1dir2dir3 这几个目录,需要分别被分到 github.com/yourname/dir1gitlab.com/yourname/dir2gitee.com/yourname/dir3 仓库中,用以下命令配置。

mkdir -p config/
cat << EOF > config/map.txt
dir1  github.com/yourname/dir1
dir2  gitlab.com/yourname/dir2
dir3  gitee.com/yourname/dir3
EOF

配置完成后启动 Docker 容器,默认每天凌晨 2 点备份一次。

docker run -itd --restart \
-v /var/www/data:/data \
-v $(pwd)/config:/config \
--name gitbackup \
wqyjh/gitbackup

如果需要手动指定备份频率与时机,可以通过 CRON 环境变量指定,例如 CRON=0 4 * * * 指定每天凌晨 4 点备份。

docker run -itd --restart \
-v /var/www/data:/data \
-v $(pwd)/config:/config \
-e "CRON=0   4    *   *   *" \
--name gitbackup \
wqyjh/gitbackup

手动构建镜像

有需要的话,可以自行修改并构建镜像。

docker build --build-arg MIRROR=mirrors.tuna.tsinghua.edu.cn . -t wqyjh/gitbackup

gitbackup's People

Contributors

wqyjh 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.