SeaweedFS is a distributed storage system for object storage (S3), file systems, Iceberg table buckets, and Lance vector buckets, designed to handle billions of files with O(1) disk access and effortless horizontal scaling.
Go blob-storagecloud-drivedistributed-file-systemdistributed-storageerasure-codingfusehadoop-hdfshdfskuberneteslancelancedbobject-storageposixs3s3-storageseaweedfstiered-file-systemvector-search
replicate: incremental sink only contains new and updated files
Chris Lu9a06c35da40b
diff --git a/weed/command/scaffold.go b/weed/command/scaffold.goindex 3ac7c021d4..58143a0add 100644--- a/weed/command/scaffold.go+++ b/weed/command/scaffold.go@@ -356,7 +356,8 @@ enabled = falsedirectory = "/data"[sink.local_incremental]-# all replicated files are under creation time as yyyy-mm-dd directories+# all replicated files are under modified time as yyyy-mm-dd directories+# so each date directory contains all new and updated files.enabled = falsedirectory = "/backup"diff --git a/weed/replication/replicator.go b/weed/replication/replicator.goindex 90e1f7cdd6..7688029e60 100644--- a/weed/replication/replicator.go+++ b/weed/replication/replicator.go@@ -43,13 +43,13 @@ func (r *Replicator) Replicate(ctx context.Context, key string, message *filer_p}var dateKey stringif r.sink.GetName() == "local_incremental" {- var cTime int64+ var mTime int64if message.NewEntry != nil {- cTime = message.NewEntry.Attributes.Crtime+ mTime = message.NewEntry.Attributes.Mtime} else if message.OldEntry != nil {- cTime = message.OldEntry.Attributes.Crtime+ mTime = message.OldEntry.Attributes.Mtime}- dateKey = time.Unix(cTime, 0).Format("2006-01-02")+ dateKey = time.Unix(mTime, 0).Format("2006-01-02")}newKey := util.Join(r.sink.GetSinkToDirectory(), dateKey, key[len(r.source.Dir):])glog.V(3).Infof("replicate %s => %s", key, newKey)