diff options
Diffstat (limited to 'weed/shell')
| -rw-r--r-- | weed/shell/command_fs_du.go | 4 | ||||
| -rw-r--r-- | weed/shell/command_s3_bucket_quota.go | 10 |
2 files changed, 9 insertions, 5 deletions
diff --git a/weed/shell/command_fs_du.go b/weed/shell/command_fs_du.go index 71003714d..a9d704f37 100644 --- a/weed/shell/command_fs_du.go +++ b/weed/shell/command_fs_du.go @@ -45,7 +45,7 @@ func (c *commandFsDu) Do(args []string, commandEnv *CommandEnv, writer io.Writer blockCount, byteCount, err = duTraverseDirectory(writer, commandEnv, dir, name) if name == "" && err == nil { - fmt.Fprintf(writer, "block:%4d\tbyte:%10d\t%s\n", blockCount, byteCount, dir) + fmt.Fprintf(writer, "block:%4d\tlogical size:%10d\t%s\n", blockCount, byteCount, dir) } return @@ -76,7 +76,7 @@ func duTraverseDirectory(writer io.Writer, filerClient filer_pb.FilerClient, dir } if name != "" && !entry.IsDirectory { - fmt.Fprintf(writer, "block:%4d\tbyte:%10d\t%s/%s\n", fileBlockCount, fileByteCount, dir, entry.Name) + fmt.Fprintf(writer, "block:%4d\tlogical size:%10d\t%s/%s\n", fileBlockCount, fileByteCount, dir, entry.Name) } return nil }) diff --git a/weed/shell/command_s3_bucket_quota.go b/weed/shell/command_s3_bucket_quota.go index 17be1d5b0..b7dbe416a 100644 --- a/weed/shell/command_s3_bucket_quota.go +++ b/weed/shell/command_s3_bucket_quota.go @@ -4,8 +4,9 @@ import ( "context" "flag" "fmt" - "github.com/chrislusf/seaweedfs/weed/pb/filer_pb" "io" + + "github.com/chrislusf/seaweedfs/weed/pb/filer_pb" ) func init() { @@ -23,7 +24,7 @@ func (c *commandS3BucketQuota) Help() string { return `set/remove/enable/disable quota for a bucket Example: - s3.bucket.quota -name=<bucket_name> -operation=set -sizeMB=1024 + s3.bucket.quota -name=<bucket_name> -op=set -sizeMB=1024 ` } @@ -31,7 +32,7 @@ func (c *commandS3BucketQuota) Do(args []string, commandEnv *CommandEnv, writer bucketCommand := flag.NewFlagSet(c.Name(), flag.ContinueOnError) bucketName := bucketCommand.String("name", "", "bucket name") - operationName := bucketCommand.String("op", "set", "operation name [set|remove|enable|disable]") + operationName := bucketCommand.String("op", "set", "operation name [set|get|remove|enable|disable]") sizeMB := bucketCommand.Int64("sizeMB", 0, "bucket quota size in MiB") if err = bucketCommand.Parse(args); err != nil { return nil @@ -63,6 +64,9 @@ func (c *commandS3BucketQuota) Do(args []string, commandEnv *CommandEnv, writer switch *operationName { case "set": bucketEntry.Quota = *sizeMB * 1024 * 1024 + case "get": + fmt.Fprintf(writer, "bucket quota: %dMiB \n", bucketEntry.Quota/1024/1024) + return nil case "remove": bucketEntry.Quota = 0 case "enable": |
