Skip to content

sanjusss/backup2cloud

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Docker Build Status Build status GitHub release GitHub license
GitHub tag GitHub issues GitHub forks GitHub stars GitHub repo size in bytes

用途

定时将服务器上的文件或文件夹备份到网络云存储(OSS或S3)。
可以设置在多个时间点,备份多个文件或文件夹到多个网络云存储。

支持的云存储

服务提供商 产品名称 是否支持 备注
阿里云 OSS 支持
腾讯云 COS 支持
百度云 BOS 支持
七牛云 对象存储 支持
AWS S3 支持
UCloud UFile 支持
华为云 OBS 支持
京东云 对象存储 支持
青云 对象存储 支持
金山云 对象存储 不支持 仅限企业用户
Azure Blob 存储 支持
Google Cloud Google Cloud Storage 支持
自定义 FTP 支持

支持的数据源

数据源 是否支持
本地文件 支持
本地文件夹 支持
MySQL 即将到来
SQL Server 即将到来
Oracle 即将到来
自定义命令 支持
FTP文件 支持
FTP文件文件夹 支持

支持的备份触发方式

触发方式 是否支持
Cron 表达式 支持
本地文件发生变化 即将到来
本地文件夹发生变化 即将到来

使用方法(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

运行后将在D:\share\eg.json生成示例配置文件。
如果省略-s /conf/eg.json,将不保存文件,仅在命令行下输出。
实际的配置文件中没有Tips一项。
其他配置参数见查看示例

使用方法(Windows)

下载

点我打开软件下载页面

运行

backup2cloud run -c D:\backup2cloud.json

运行后程序将加载配置文件backup2cloud.json。

查看示例

  1. 查看一个示例配置文件
backup2cloud eg -s D:\share\eg.json

运行后将在D:\share\eg.json生成示例配置文件。
如果省略-s D:\share\eg.json,将不保存文件,仅在命令行下输出。
实际的配置文件中没有Tips一项。

  1. 查看所有上传类名称
backup2cloud eg -l uploader
  1. 查看所有数据源类名称
backup2cloud eg -l datasource
  1. 查看指定上传类示例
backup2cloud eg -u 上传类名称
  1. 查看指定数据源类示例
backup2cloud eg -d 数据源类名称

配置文件说明

待补充

引用项目

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/backup2cloud
https://github.com/fengyhack/csharp-sdk
https://github.com/sanjusss/ucloud-csharp-sdk
https://github.com/aws/aws-sdk-net/
https://github.com/awslabs/aws-sdk-net-samples
https://support.huaweicloud.com/devg-obs_csharp_sdk_doc_zh/zh-cn_topic_0120606335.html
https://github.com/GoogleCloudPlatform/google-cloud-dotnet
https://github.com/Azure/azure-storage-net