From 5e234016a2e82c6f77df1bf0e2fc3038ae0a4b89 Mon Sep 17 00:00:00 2001 From: sanjusss Date: Tue, 11 Sep 2018 15:17:10 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E5=A2=9E=E5=8A=A0Windows=E7=89=88?= =?UTF-8?q?=E3=80=82=202=E3=80=81=E9=99=8D=E4=BD=8E.NET=20Core=E7=89=88?= =?UTF-8?q?=E6=9C=AC=E5=88=B02.0=E3=80=82=203=E3=80=81=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E4=B8=83=E7=89=9B=E4=BA=91=E4=B8=8A=E4=BC=A0=E5=A4=B1=E8=B4=A5?= =?UTF-8?q?=E6=B2=A1=E6=9C=89=E5=BC=82=E5=B8=B8=E7=9A=84bug=E3=80=82=204?= =?UTF-8?q?=E3=80=81=E5=A2=9E=E5=8A=A0=E8=87=AA=E5=8A=A8=E6=9E=84=E5=BB=BA?= =?UTF-8?q?=E8=84=9A=E6=9C=AC=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Backup2Cloud/Backup2Cloud.csproj | 8 ++--- README.md | 54 ++++++++++++++++++++++++++------ appveyor.yml | 34 ++++++++++++++++++++ backup2cloud.sln | 1 + 4 files changed, 84 insertions(+), 13 deletions(-) create mode 100644 appveyor.yml diff --git a/Backup2Cloud/Backup2Cloud.csproj b/Backup2Cloud/Backup2Cloud.csproj index 737ae29..99af927 100644 --- a/Backup2Cloud/Backup2Cloud.csproj +++ b/Backup2Cloud/Backup2Cloud.csproj @@ -2,12 +2,12 @@ Exe - netcoreapp2.1 + netcoreapp2.0 false - 0.0.2.0911 - 0.0.2.0911 - 0.0.2.0911 + 0.0.3.0911 + 0.0.3.0911 + 0.0.3.0911 sanjusss 定时将服务器上的文件备份到云存储。 diff --git a/README.md b/README.md index 4ba7310..2e5b2c3 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,9 @@  [![Docker Automated build](https://img.shields.io/docker/automated/sanjusss/backup2cloud.svg)](https://hub.docker.com/r/sanjusss/backup2cloud) [![Docker Build Status](https://img.shields.io/docker/build/sanjusss/backup2cloud.svg)](https://hub.docker.com/r/sanjusss/backup2cloud) +[![Build status](https://ci.appveyor.com/api/projects/status/9sa1mtm53jxket5t?svg=true)](https://ci.appveyor.com/project/sanjusss/backup2cloud) +[![GitHub release](https://img.shields.io/github/release/sanjusss/backup2cloud.svg)](https://github.com/sanjusss/backup2cloud/releases) +[![GitHub tag](https://img.shields.io/github/tag/sanjusss/backup2cloud.svg)](https://github.com/sanjusss/backup2cloud/tags) [![GitHub issues](https://img.shields.io/github/issues/sanjusss/backup2cloud.svg)](https://github.com/sanjusss/backup2cloud/issues) [![GitHub forks](https://img.shields.io/github/forks/sanjusss/backup2cloud.svg)](https://github.com/sanjusss/backup2cloud/network) [![GitHub stars](https://img.shields.io/github/stars/sanjusss/backup2cloud.svg)](https://github.com/sanjusss/backup2cloud/stargazers) @@ -11,13 +14,14 @@ 可以设置在多个时间点,备份多个文件或文件夹到多个网络云存储。 # 支持的云存储 -[阿里云OSS](https://www.aliyun.com/product/oss) -[腾讯云COS](https://cloud.tencent.com/product/cos) -[百度云BOS](https://cloud.baidu.com/product/bos.html) -[七牛云对象存储](https://www.qiniu.com/products/kodo) +[阿里云OSS](https://www.aliyun.com/product/oss)、 +[腾讯云COS](https://cloud.tencent.com/product/cos)、 +[百度云BOS](https://cloud.baidu.com/product/bos.html)、 +[七牛云对象存储](https://www.qiniu.com/products/kodo) + # 使用方法(Docker) -## 运行 +### 运行 ``` docker run -d --restart=always -v /etc/localtime:/etc/localtime:ro -v /xxx/yyy:/data -v /etc/backup2cloud:/conf sanjusss/backup2cloud run -c /conf/backup2cloud.json ``` @@ -25,7 +29,7 @@ docker run -d --restart=always -v /etc/localtime:/etc/localtime:ro -v /xxx/yyy:/ `-v /etc/localtime:/etc/localtime:ro`保证了docker容器内时区和外部环境一样,否则默认使用UTC时间。 注意文件夹的挂载。 -## 查看示例配置文件 +### 查看示例配置文件 ``` docker run --rm -v /D/share:/conf sanjusss/backup2cloud eg -s /conf/eg.json ``` @@ -34,16 +38,48 @@ docker run --rm -v /D/share:/conf sanjusss/backup2cloud eg -s /conf/eg.json 示例文件 [点我](https://github.com/sanjusss/backup2cloud/blob/master/example.json) 实际的配置文件中没有Tips一项。 -## 查看命令帮助 +### 查看命令帮助 ``` docker run --rm sanjusss/backup2cloud --help ``` -## 查看软件版本 +### 查看软件版本 ``` docker run --rm sanjusss/backup2cloud --version ``` + +# 使用方法(Windows) +### 下载 +[点我打开软件下载页面](https://github.com/sanjusss/backup2cloud/releases) +除了软件本体之外,还需要安装.NET Core 2.0或更新运行库。[点我打开下载页面](https://www.microsoft.com/net/download),选择`Download .NET Core Runtime`下载。 + +### 运行 +``` +backup2cloud run -c D:\backup2cloud.json +``` +运行后程序将加载配置文件backup2cloud.json。 + +### 查看示例配置文件 +``` +backup2cloud eg -s D:\share\eg.json +``` +运行后将在D:\share\eg.json生成示例配置文件。 +如果省略`-s D:\share\eg.json`,将不保存文件,仅在命令行下输出。 +示例文件 [点我](https://github.com/sanjusss/backup2cloud/blob/master/example.json) +实际的配置文件中没有Tips一项。 + +### 查看命令帮助 +``` +backup2cloud --help +``` + +### 查看软件版本 +``` +backup2cloud --version +``` + + # 引用项目 https://www.newtonsoft.com/json https://github.com/vla/aliyun-oss-csharp-sdk @@ -51,5 +87,5 @@ https://github.com/commandlineparser/commandline https://github.com/zhengchun/qcloud-sdk-net https://github.com/adamhathcock/sharpcompress https://www.quartz-scheduler.net -https://github.com/sanjusss/bce-sdk-dotnet +https://github.com/sanjusss/backup2cloud https://github.com/fengyhack/csharp-sdk diff --git a/appveyor.yml b/appveyor.yml new file mode 100644 index 0000000..1d8195c --- /dev/null +++ b/appveyor.yml @@ -0,0 +1,34 @@ + +version: 0.0.3.0911.{build} +branches: + only: + - master +image: Visual Studio 2017 +shallow_clone: true +build_script: +- cmd: >- + dotnet build -c Release -o result . + + dotnet publish -c Release -o publish . + + dotnet publish -c Release -r win-x86 -o publishwin86 . + + dotnet publish -c Release -r win-x64 -o publishwin64 . +artifacts: +- path: Backup2Cloud\publish + name: backup2cloud-$(APPVEYOR_BUILD_VERSION)-dotnet-core + type: WebDeployPackage +- path: Backup2Cloud\publishwin86 + name: backup2cloud-$(APPVEYOR_BUILD_VERSION)-win-x86 + type: WebDeployPackage +- path: Backup2Cloud\publishwin64 + name: backup2cloud-$(APPVEYOR_BUILD_VERSION)-win-x64 + type: WebDeployPackage +deploy: +- provider: GitHub + auth_token: + secure: VFLWVehXTfNaqBsG5F8ZkEWTFKvDxhk71wQJ+ZDspUEoqfvXpbQwkB0OA/N+r/qD + draft: false + force_update: true + on: + APPVEYOR_REPO_TAG: true \ No newline at end of file diff --git a/backup2cloud.sln b/backup2cloud.sln index c9f9723..97764a8 100644 --- a/backup2cloud.sln +++ b/backup2cloud.sln @@ -7,6 +7,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Backup2Cloud", "Backup2Clou EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{0EB540FC-0438-454B-9515-2FA2B25B5BCA}" ProjectSection(SolutionItems) = preProject + appveyor.yml = appveyor.yml Dockerfile = Dockerfile example.json = example.json LICENSE = LICENSE