GithubHelp home page GithubHelp logo

oss-sync's Introduction

oss-sync

阿里云OSS 同步工具

Install

npm i oss-sync -g

How to use

$ osync <config json file>
$
$ Options:
$
$   -f, --force-upload      重新上传所有文件
$   -i, --incremental-mode  增量模式

oss-sync 会自动检测当前工作目录下是否存在.oss-sync.json并将其作为配置文件加载,设置文件应该包含这些设定:

  • source - 准备同步到 OSS 上的目录
  • dest - OSS bucket 上的目标位置
  • accessKeyId - 你的 OSS accessKeyId
  • secretAccessKey - 你的 OSS secretAccessKey
  • endpoint - OSS 实例所在地区
  • bucket - bucket 名
  • incrementalMode - 是否使用增量模式,在增量模式的情况下 oss-sync 将只会上传那些新增和修改过的文件
  • headers - 可配置上传文件的 HTTP 头设置,具体请参考 test 及 OSS 文档

Tips

  • oss-sync 通过使用 git 管理文件树生成的 md5 值来检测文件的变化,会在同步的目录下生成一个.sync的文件夹
  • oss-sync 会忽略所有以.开头的文件和文件夹
  • 文件名中若有奇怪的字符可能导致奇怪的后果
  • 若你的文件数量非常多且不太在乎 OSS 上的存储空间,建议使用增量模式

oss-sync's People

Watchers

James Cloos 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.