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
weed shell: fs.meta.save adjusts meta data file name
Chris Luaf49aea0c6d8
diff --git a/weed/shell/command_fs_meta_load.go b/weed/shell/command_fs_meta_load.goindex ef3c39f964..35fa632b0b 100644--- a/weed/shell/command_fs_meta_load.go+++ b/weed/shell/command_fs_meta_load.go@@ -26,7 +26,7 @@ func (c *commandFsMetaLoad) Name() string {func (c *commandFsMetaLoad) Help() string {return `load saved filer meta data to restore the directory and file structure- fs.meta.load <filer_host>_<port>.meta+ fs.meta.load <filer_host>-<port>-<time>.meta`}diff --git a/weed/shell/command_fs_meta_save.go b/weed/shell/command_fs_meta_save.goindex b874db31b3..47426a8583 100644--- a/weed/shell/command_fs_meta_save.go+++ b/weed/shell/command_fs_meta_save.go@@ -5,6 +5,7 @@ import ("fmt""io""os"+ "time""github.com/chrislusf/seaweedfs/weed/filer2""github.com/chrislusf/seaweedfs/weed/pb/filer_pb"@@ -24,12 +25,17 @@ func (c *commandFsMetaSave) Name() string {}func (c *commandFsMetaSave) Help() string {- return `recursively save directory and file meta data to a local file+ return `save all directory and file meta data to a local file for metadata backup.- fs.meta.save # save current meta data from current directory+ fs.meta.save / # save from the root+ fs.meta.save /path/to/save # save from the directory /path/to/save+ fs.meta.save . # save from current directory+ fs.meta.save # save from current directory- The meta data will be saved into a local <filer_host>_<port>.meta file.- These meta data can be later loaded by fs.meta.load command.+ The meta data will be saved into a local <filer_host>-<port>-<time>.meta file.+ These meta data can be later loaded by fs.meta.load command,++ This assumes there are no deletions, so this is different from taking a snapshot.`}@@ -45,7 +51,9 @@ func (c *commandFsMetaSave) Do(args []string, commandEnv *commandEnv, writer io.return commandEnv.withFilerClient(ctx, filerServer, filerPort, func(client filer_pb.SeaweedFilerClient) error {- fileName := fmt.Sprintf("%s-%d.meta", filerServer, filerPort)+ t := time.Now()+ fileName := fmt.Sprintf("%s-%d-%4d%02d%02d-%02d%02d%02d.meta",+ filerServer, filerPort, t.Year(), t.Month(), t.Day(), t.Hour(), t.Minute(), t.Second())dst, err := os.OpenFile(fileName, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0644)if err != nil {