Giter Club home page Giter Club logo

osd-tool's Introduction

osd-tool

腾讯云(cos)或阿里云(oss)的对象存储 目录上传、下载工具,当前只是简单的全量上传和下载,用于跨服务商迁移文件、跨设备迁移文件、内容备份等场景

Go GitHub release (latest by date) GitHub go.mod Go version MIT License Go Report

用法

# 有golang环境时可以通过go install下载安装,或者直接下载当前项目发布的包
go install github.com/jorben/osd-tool@latest

# 首次使用时候可以通过init命令初始化配置文件模版,默认生成config.yaml文件
osd-tool init

# 配置好相应的配置内容...

# 把配置文件中配置的upload list上传到对象存储
osd-tool upload

# 把配置文件中配置的download list下载到本地
osd-tool download

# 升级当前程序
osd-tool --upgrade

存储器类型配置

# 存储对象 cos 或者 oss (分别是腾讯云和阿里云)
# 下方需要对应配置 cos或oss的密钥等信息
storage: cos

上传配置

在配置文件中配置要上传的目录和目标路径,source为本地路径,dest为cos路径。比如下方配置将会把本地的sync1目录下的文件及文件夹上传到COS的/syncTest/dir1目录下:

upload:
  list:
    - source: /Users/Jorben/Downloads/sync1
      dest: /syncTest/dir1
    - source: /Users/Jorben/Downloads/sync2
      dest: /syncTest/2dir
  ignore: [ .git, .DS_Store ] # 需要忽略的文件和文件夹

下载配置

在配置文件中配置要下载的目录和目标路径,source为cos路径,dest为本地路径。比如下方配置将会把cos上的syncTest目录下的文件及子目录下载到本地的downloadTest目录下:

download:
  list:
    - source: /syncTest
      dest: /Users/Jorben/Downloads/downloadTest

对象存储配置

osd:
  secret_id:
  secret_key:
  bucket: # 存储桶的名称,注意cos的存储桶名称带有APPID,
  region:  # 替换成存储桶的区域代码,比如Oss的cn-shenzhen,比如Cos的ap-guangzhou
  timeout: 300 #单位:秒

License

Released under the MIT License.

osd-tool's People

Contributors

haywolf avatar jorben avatar

Stargazers

 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.