restic 快速安全可靠的数据备份工具

restic 是基于golang 编写的快速,安全,可靠的数据备份工具,使用简单,同时支持多种后端存储

支持的后端存储

  • 本地
  • sftp (通过ssh)
  • http rest server (rest-server restic提供的 )
  • s3 (同时支持minio)
  • openstack swift
  • backblaze b2
  • azure blob storage
  • google cloud storage
  • 以及其他可以通过rclone 访问的后端存储

minio 简单集成使用

 
version: '3.7'
services:
  sidekick:
    image: dalongrong/sidekick:v0.1.8
    tty: true
    ports:
    - "80:80"
    command: --health-path=/minio/health/ready --address :80 http://minio{1...4}:9000
  gateway:
    image: minio/minio:RELEASE.2020-04-04T05-39-31Z
    command: gateway s3 http://sidekick
    environment:
      MINIO_ACCESS_KEY: minio
      MINIO_SECRET_KEY: minio123
    ports:
    - "9000:9000"
  minio1:
    image: minio/minio:RELEASE.2020-04-04T05-39-31Z
    volumes:
      - data1-1:/data1
      - data1-2:/data2
    ports:
      - "9001:9000"
    environment:
      MINIO_ACCESS_KEY: minio
      MINIO_SECRET_KEY: minio123
      MINIO_BROWSER: "off"
    command: server http://minio{1...4}/data{1...2}
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
      interval: 30s
      timeout: 20s
      retries: 3
  minio2:
    image: minio/minio:RELEASE.2020-04-04T05-39-31Z
    volumes:
      - data2-1:/data1
      - data2-2:/data2
    ports:
      - "9002:9000"
    environment:
      MINIO_ACCESS_KEY: minio
      MINIO_SECRET_KEY: minio123
      MINIO_BROWSER: "off"
    command: server http://minio{1...4}/data{1...2}
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
      interval: 30s
      timeout: 20s
      retries: 3
  minio3:
    image: minio/minio:RELEASE.2020-04-04T05-39-31Z
    volumes:
      - data3-1:/data1
      - data3-2:/data2
    ports:
      - "9003:9000"
    environment:
      MINIO_ACCESS_KEY: minio
      MINIO_SECRET_KEY: minio123
      MINIO_BROWSER: "off"
    command: server http://minio{1...4}/data{1...2}
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
      interval: 30s
      timeout: 20s
      retries: 3
  minio4:
    image: minio/minio:RELEASE.2020-04-04T05-39-31Z
    volumes:
      - data4-1:/data1
      - data4-2:/data2
    ports:
      - "9004:9000"
    environment:
      MINIO_ACCESS_KEY: minio
      MINIO_SECRET_KEY: minio123
      MINIO_BROWSER: "off"
    command: server http://minio{1...4}/data{1...2}
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
      interval: 30s
      timeout: 20s
      retries: 3
volumes:
  data1-1:
  data1-2:
  data2-1:
  data2-2:
  data3-1:
  data3-2:
  data4-1:
  data4-2:
 
 
export AWS_ACCESS_KEY_ID=minio
export AWS_SECRET_ACCESS_KEY=minio123
  • 初始化restic
restic -r s3:http://localhost/backup init

效果

 

 


 

 

  • 进行数据备份操作
restic -r s3:http://localhost/backup backup ./

效果

 

 

 

 

  • 查看备份
 
restic -r s3:http://localhost/backup snapshots

效果

 

 

  • 查看备份内容
 
restic -r s3:http://localhost/backup ls 875a2a32

效果

 

 

  • 数据恢复
 
restic -r s3:http://localhost/backup restore 875a2a32 -t ./

效果

 

 

说明

restic 是一个很不错的数据备份方案,rclone是一个不错的数据同步方案,以及minio作为数据存储,集成在一起真的很不错

参考资料

https://restic.readthedocs.io/en/stable/
https://github.com/restic/restic
https://github.com/rongfengliang/minio-cluster-sidekick-learning

posted on   荣锋亮  阅读(2971)  评论(0编辑  收藏  举报

编辑推荐:
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· 没有源码,如何修改代码逻辑?
阅读排行:
· 全程不用写代码,我用AI程序员写了一个飞机大战
· DeepSeek 开源周回顾「GitHub 热点速览」
· 记一次.NET内存居高不下排查解决与启示
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· .NET10 - 预览版1新功能体验(一)
历史上的今天:
2019-04-05 algernon 基于golang 的独立的支持redis lua pg。。。 的web server
2018-04-05 elixir mix开发入门
2018-04-05 memsql 基本安装试用
2017-04-05 maven docker plugin 常见问题解决

导航

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5
点击右上角即可分享
微信分享提示