Commit Graph
26 Commits
Author SHA1 Message Date
Chris LuandGitHub 294f7c3d04 shell: expand ~ in local file path arguments (#9265)
* shell: expand `~` in local file path arguments

The weed shell parses commands itself instead of going through an OS
shell, so a path like `~/Downloads/foo.meta` was passed verbatim to
`os.Open`, which fails because no `~` directory exists. Users had to
spell out absolute home paths in every command.

Add an `expandHomeDir` helper that resolves a leading `~` or `~/...` to
the user's home directory, and run user-supplied local file paths in
the affected shell commands through it:

  fs.meta.load          (positional file)
  fs.meta.save          (-o)
  fs.meta.changeVolumeId (-mapping)
  s3.iam.export         (-file)
  s3.iam.import         (-file)
  s3.policy             (-file)
  s3tables.bucket       (-file)
  s3tables.table        (-file, -metadata)
  volume.fsck           (-tempPath)

Filer-namespace path flags (`-dir`, `-path`, `-locationPrefix`, etc.)
are unaffected; they live in the filer, not on the local FS.

* shell: reuse util.ResolvePath instead of a new helper

util.ResolvePath already does tilde expansion; drop the local
expandHomeDir helper and route every shell call site through it.
2026-04-28 12:30:13 -07:00
Feng ShaoandGitHub 963398ac8c use ReadFull (#40) (#8240)
* use ReadFull

* fix error checking
2026-02-06 20:51:47 -08:00
Feng ShaoandGitHub 0299e78de7 de/compress the fs meta file if filename ends with gz/gzip (#7500)
* de/compress the fs meta file if filename ends with gz/gzip

* gemini code review

* update help msg
2025-11-18 07:45:12 -08:00
165af32d6b added context to filer_client method calls (#6808)
Co-authored-by: akosov <a.kosov@kryptonite.ru>
2025-05-22 09:46:49 -07:00
chrislu ec30a504ba refactor 2024-09-29 10:38:22 -07:00
chrislu 701abbb9df add IsResourceHeavy() to command interface 2024-09-28 20:23:01 -07:00
Chris LuandGitHub cfcf383ee7 fix wrong prefix example 2024-05-21 21:45:29 -07:00
VladandGitHub a9b057389f chore: add missing concurrency help in fs.meta.load command (#5609) 2024-05-21 21:42:48 -07:00
Konstantin LebedevandGitHub 183352c796 shell meta load add concurrency (#4529)
* fix: increase speed cmd fs meta load

* fix: add wg
2023-12-28 11:54:37 -08:00
Konstantin LebedevandGitHub faa6167b6b fs.meta.load load any dirs with prefix "important" (#3747)
* fs.meta.load load any dirs with prefix "important"

* replace dirPattern to dirPrefix

* help dirPrefix
2022-09-27 09:58:46 -07:00
chrislu 7eb121d5ae print process before do the work 2022-08-30 13:37:05 -07:00
chrislu eaeb141b09 move proto package 2022-08-17 12:05:07 -07:00
chrislu d3d52b1818 shell: fs.meta.load add quieter mode
fix https://github.com/seaweedfs/seaweedfs/issues/3414
2022-08-07 01:42:15 -07:00
chrislu 26dbc6c905 move to https://github.com/seaweedfs/seaweedfs 2022-07-29 00:17:28 -07:00
chrislu 9f9ef1340c use streaming mode for long poll grpc calls
streaming mode would create separate grpc connections for each call.
this is to ensure the long poll connections are properly closed.
2021-12-26 00:15:03 -08:00
Chris Lu b971317a16 avoid possible corrupted file names 2021-04-15 11:41:34 -07:00
Chris Lu e666aeece2 simplify parsing filer host and port 2020-03-23 21:26:15 -07:00
Chris Lu c0f0fdb3ba refactoring 2020-03-23 00:01:34 -07:00
Chris Lu 892e726eb9 avoid reusing context object
fix https://github.com/chrislusf/seaweedfs/issues/1182
2020-02-25 21:50:12 -08:00
Chris Lu 72a64a5cf8 use the same context object in order to retry 2020-01-26 14:42:11 -08:00
Chris Lu c48fc8b4de grpc send error via response instead of grpc error 2020-01-25 09:17:19 -08:00
Chris Lu ede876cfdb periodic scripts exeuction from leader master 2019-06-05 01:30:24 -07:00
Chris Lu 575926cdec minor 2019-04-26 09:32:37 -07:00
Chris Lu b142f9f1d5 go fmt 2019-04-18 00:19:18 -07:00
Chris Lu af49aea0c6 weed shell: fs.meta.save adjusts meta data file name 2019-04-16 09:40:27 -07:00
Chris Lu 014906ec79 weed shell: add command fs.meta.load to restore meta data 2019-04-16 01:37:11 -07:00