@teambun/coscp
v3.1.3
Published
Efficient file transfer for QCloud COS.
Readme
coscp
Efficient file transfer for QCloud COS.
Features
- Incremental Upload
- Concurrency Support
- Report Sheet
- Enable / Disable / Customize HTTP Cache
Installation
$ npm install -g @teambun/coscpConfig
$ coscp gen-configAfter generating ~/.coscprc.yml, read instructions in the file, set it properly.
Usage
$ coscp source bucket:targetCache 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
- multiple file transfer https://stackoverflow.com/a/21110306/1793548
- download
coscp bucket:files local
LICENSE
MIT
