Skip to content

YIIZ/coscp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

d1a94c7 · Mar 19, 2023
Mar 19, 2023
Sep 13, 2018
Jun 13, 2018
Jun 16, 2018
Jun 13, 2018
Sep 17, 2018
Mar 19, 2023
Jun 18, 2018
Jun 13, 2018
Jul 14, 2018
Jun 15, 2021
Mar 19, 2023

Repository files navigation

coscp

code style: prettier NPM Downloads

Efficient file transfer for QCloud COS.

Features

  • Incremental Upload
  • Concurrency Support
  • Report Sheet
  • Enable / Disable / Customize HTTP Cache

Installation

$ npm install -g @teambun/coscp

Config

$ coscp gen-config

After generating ~/.coscprc.yml, read instructions in the file, set it properly.

Usage

$ coscp source bucket:target

Cache Policy

Default cache policy for development without --cache option:

File Type / File Name Expire
All 60 seconds

Cache policy for production with --cache auto option:

File Type / File Name Expire
*.html, *.stale.* 60 seconds
Others 1 year

Customize cache policy with --cache option, such as:

  • --cache 0: disable cache.
  • --cache 3600: set cache time to 1 hour.

Programmatic API

async function coscp(sourceDirectory, targetDirectory, concurrency, config, interactive, cache)

Argument Type Default Value
sourceDirectory String NA
targetDirectory String NA
concurrency Number 5
config Object{ AppId, SecretId, SecretKey, Bucket, Region } NA
interactive Boolean true
cache Number NA

TODO

  1. multiple file transfer https://stackoverflow.com/a/21110306/1793548
  2. download coscp bucket:files local

LICENSE

MIT