Skip to content

Commit

Permalink
1、增加Windows版。
Browse files Browse the repository at this point in the history
2、降低.NET Core版本到2.0。
3、修复七牛云上传失败没有异常的bug。
4、增加自动构建脚本。
  • Loading branch information
sanjusss committed Sep 11, 2018
1 parent a079b0e commit 5e23401
Show file tree
Hide file tree
Showing 4 changed files with 84 additions and 13 deletions.
8 changes: 4 additions & 4 deletions Backup2Cloud/Backup2Cloud.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.1</TargetFramework>
<TargetFramework>netcoreapp2.0</TargetFramework>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
<NeutralLanguage></NeutralLanguage>
<AssemblyVersion>0.0.2.0911</AssemblyVersion>
<FileVersion>0.0.2.0911</FileVersion>
<Version>0.0.2.0911</Version>
<AssemblyVersion>0.0.3.0911</AssemblyVersion>
<FileVersion>0.0.3.0911</FileVersion>
<Version>0.0.3.0911</Version>
<Authors>sanjusss</Authors>
<Company />
<Description>定时将服务器上的文件备份到云存储。</Description>
Expand Down
54 changes: 45 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -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)
Expand All @@ -11,21 +14,22 @@
可以设置在多个时间点,备份多个文件或文件夹到多个网络云存储。

# 支持的云存储
[阿里云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
```
运行后程序将加载配置文件backup2cloud.json。
`-v /etc/localtime:/etc/localtime:ro`保证了docker容器内时区和外部环境一样,否则默认使用UTC时间。
注意文件夹的挂载。

## 查看示例配置文件
### 查看示例配置文件
```
docker run --rm -v /D/share:/conf sanjusss/backup2cloud eg -s /conf/eg.json
```
Expand All @@ -34,22 +38,54 @@ 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
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
34 changes: 34 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions backup2cloud.sln
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5e23401

Please sign in to comment.