diff options
| author | Alexander <4584443+DragonStuff@users.noreply.github.com> | 2021-08-29 11:47:35 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-08-29 11:47:35 +0900 |
| commit | ab0ebe1d3b89e1cdf53471e3b43830f5cc1f01a8 (patch) | |
| tree | d041c13bed16bde0d4184e852729e8d8724304b9 /weed/shell/command_remote_unmount.go | |
| parent | 4128c1126a614873ea64beffc762856c4933d0aa (diff) | |
| parent | 8b7063634f5b2f9fa0a58a36260f881ee18ebd13 (diff) | |
| download | seaweedfs-ab0ebe1d3b89e1cdf53471e3b43830f5cc1f01a8.tar.xz seaweedfs-ab0ebe1d3b89e1cdf53471e3b43830f5cc1f01a8.zip | |
Merge branch 'chrislusf:master' into master
Diffstat (limited to 'weed/shell/command_remote_unmount.go')
| -rw-r--r-- | weed/shell/command_remote_unmount.go | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/weed/shell/command_remote_unmount.go b/weed/shell/command_remote_unmount.go index 55b9bce05..c2857dbbf 100644 --- a/weed/shell/command_remote_unmount.go +++ b/weed/shell/command_remote_unmount.go @@ -31,7 +31,9 @@ func (c *commandRemoteUnmount) Help() string { remote.mount -dir=/xxx -remote=s3_1/bucket # unmount the mounted directory and remove its cache - remote.unmount -dir=/xxx + # Make sure you have stopped "weed filer.remote.sync" first! + # Otherwise, the deletion will also be propagated to the remote storage!!! + remote.unmount -dir=/xxx -iHaveStoppedRemoteSync ` } @@ -41,6 +43,7 @@ func (c *commandRemoteUnmount) Do(args []string, commandEnv *CommandEnv, writer remoteMountCommand := flag.NewFlagSet(c.Name(), flag.ContinueOnError) dir := remoteMountCommand.String("dir", "", "a directory in filer") + hasStoppedRemoteSync := remoteMountCommand.Bool("iHaveStoppedRemoteSync", false, "confirm to stop weed filer.remote.sync first") if err = remoteMountCommand.Parse(args); err != nil { return nil @@ -59,6 +62,9 @@ func (c *commandRemoteUnmount) Do(args []string, commandEnv *CommandEnv, writer return fmt.Errorf("directory %s is not mounted", *dir) } + if !*hasStoppedRemoteSync { + return fmt.Errorf("make sure \"weed filer.remote.sync\" is stopped to avoid data loss") + } // purge mounted data if err = c.purgeMountedData(commandEnv, *dir); err != nil { return fmt.Errorf("purge mounted data: %v", err) |
