标签:rgba conf string oss ring virtual div pen turn
初始化repo: restic -o s3.bucket-lookup=dns -o s3.region=oss-cn-beijing -r s3:https://xxx(bucket_name).oss-cn-beijing.aliyuncs.com init
-o s3.bucket-lookup=dns: 通过Virtual path host连接(阿里云限制)
-o s3.region=oss-cn-beijing: bucket所在区域
-r s3:https://xxx(bucket_name).oss-cn-beijing.aliyuncs.com: Bucket域名
备份: restic -r s3:https://xxx(bucket_name).oss-cn-beijing.aliyuncs.com --verbose backup c:\temp(需要备份的目录或文件)
--verbose: 显示详细信息
需要修改代码, Go语言不太熟悉, 改的合不合理不太清楚.
文件: internal/backend/s3/config.go
修改前(57~62行):
if url.Path == "" { return nil, errors.New("s3: bucket name not found") } path := strings.SplitN(url.Path[1:], "/", 2) return createConfig(url.Host, path, url.Scheme == "http")
修改后:
var path []string if url.Path == "" { temps := strings.SplitN(url.Host, ".", 2) path = append(path, temps[0]) url.Host = temps[1] } else { path = strings.SplitN(url.Path[1:], "/", 2) }
标签:rgba conf string oss ring virtual div pen turn
原文地址:https://www.cnblogs.com/hfpiao/p/14291462.html