Nick et all,
First off -- cool product. I have downloaded current release.
Brainstorming idea
Is it in your business model to consider using versioned S3 repositories. IMHO, if S3 is the only provider that has versioned repos and not all S3 vendors have them the answer is NO. That is ok.
That said:
Jostification: With versioning you could solve a myriad of backup issues.
-
With Versioning RClone Mount could pick any point in time to mount the repository.
-
With versioning on -- rclone needs no "changes". Use mistakes that wipe out the destination S3 would be recoverable.
-
My S3 supplier is introducing something for S3 lifecycle in the next quarter
-
Using Rclone instead of a full DB makes since to me. I would rather see the S3 contain "clone" copies. If there is complex software creating files this could fail at the Jost in-opportune time.
In my case here here is some snippets
cfg, err := config.LoadDefaultConfig(context.TODO(), config.WithCredentialsProvider(credsProvider), config.WithEndpointResolver(aws.EndpointResolverFunc( func(service, region string) (aws.Endpoint, error) { return aws.Endpoint{URL: endpoint}, nil })))
respVers, err := client.ListObjectVersions(context.TODO(), inputVer) if err != nil { return err } printVersionOutput(*respVers)
// output the ListVersionsOutput object
func printVersionOutput(output s3.ListObjectVersionsOutput) {
log.Info(fmt.Sprintf("Bucket Name:%s", fmtStringNil(output.Name)))
log.Info(fmt.Sprintf("Delimiter:%s", fmtStringNil(output.Delimiter)))
log.Info(fmt.Sprintf("CommonPrefixes len:%d", len(output.CommonPrefixes)))
log.Info(fmt.Sprintf("DeleteMarker len:%d", len(output.DeleteMarkers)))
log.Info(fmt.Sprintf("Versions len:%d", len(output.Versions)))versions := output.Versions for inx, version := range versions { modTime := *version.LastModified log.Info(fmt.Sprintf("Inx:%d Key:%s Etag:%s Size:%d modTime:%s", inx, fmtStringNil(version.Key), fmtStringNil(version.ETag), version.Size, modTime.Format("Mon Jan 2 15:04:05"), )) log.Info(fmt.Sprintf(" VID:%s isLatest:%t\n", fmtStringNil(version.VersionId), version.IsLatest, )) }
}
Produces the following output for my 3 file repo with a couple of versions:
INFO 2021-04-19 20:39:33 Delimiter:** nil **
INFO 2021-04-19 20:39:33 CommonPrefixes len:0
INFO 2021-04-19 20:39:33 DeleteMarker len:0
INFO 2021-04-19 20:39:33 Versions len:5
INFO 2021-04-19 20:39:33 Inx:0 Key:Sample/ Etag:"d41d8cd98f00b204e9800998ecf8427e" Size:0 modTime:Wed Apr 14 02:51:21
INFO 2021-04-19 20:39:33 VID:001618368681481908872-JTm2grK7XL isLatest:trueINFO 2021-04-19 20:39:33 Inx:1 Key:Sample/File1.txt Etag:"e35ed419723a71491433dcb889ec51ac" Size:101 modTime:Wed Apr 14 03:05:01
INFO 2021-04-19 20:39:33 VID:001618369500551868972-X6Xt1f5ytm isLatest:trueINFO 2021-04-19 20:39:33 Inx:2 Key:Sample/File1.txt Etag:"e7343397015af875d08d84179a21b2cd" Size:72 modTime:Wed Apr 14 03:03:42
INFO 2021-04-19 20:39:33 VID:001618369421669596521-CqsklW8ze9 isLatest:falseINFO 2021-04-19 20:39:33 Inx:3 Key:Sample/File2.txt Etag:"434d2ff65cfc2cd4e0a626fce4af86a6" Size:101 modTime:Wed Apr 14 03:05:00
INFO 2021-04-19 20:39:33 VID:001618369500471942471-bzwaSklISn isLatest:trueINFO 2021-04-19 20:39:33 Inx:4 Key:Sample/File2.txt Etag:"87d66c059c531036dcc6e84660234cbb" Size:72 modTime:Wed Apr 14 03:03:42
INFO 2021-04-19 20:39:33 VID:001618369422282553279-LLjRXY25cJ isLatest:false
With this it is easy to see how using od times one could set rclone mount and other tools to recover from the repo.
An idea an yes ok if this isn't your business model.
Allen Strand