aboutsummaryrefslogtreecommitdiff
path: root/weed/shell
diff options
context:
space:
mode:
Diffstat (limited to 'weed/shell')
-rw-r--r--weed/shell/command_remote_configure.go3
-rw-r--r--weed/shell/command_remote_unmount.go8
2 files changed, 9 insertions, 2 deletions
diff --git a/weed/shell/command_remote_configure.go b/weed/shell/command_remote_configure.go
index 4aaf7c034..8b5a04365 100644
--- a/weed/shell/command_remote_configure.go
+++ b/weed/shell/command_remote_configure.go
@@ -36,6 +36,8 @@ func (c *commandRemoteConfigure) Help() string {
remote.configure -name=cloud1 -type=s3 -s3.access_key=xxx -s3.secret_key=yyy
remote.configure -name=cloud2 -type=gcs -gcs.appCredentialsFile=~/service-account-file.json
remote.configure -name=cloud3 -type=azure -azure.account_name=xxx -azure.account_key=yyy
+ remote.configure -name=cloud4 -type=aliyun -aliyun.access_key=xxx -aliyun.secret_key=yyy -aliyun.endpoint=oss-cn-shenzhen.aliyuncs.com -aliyun.region=cn-sehnzhen
+ remote.configure -name=cloud5 -type=tencent -tencent.secret_id=xxx -tencent.secret_key=yyy -tencent.endpoint=cos.ap-guangzhou.myqcloud.com
# delete one configuration
remote.configure -delete -name=cloud1
@@ -81,7 +83,6 @@ func (c *commandRemoteConfigure) Do(args []string, commandEnv *CommandEnv, write
remoteConfigureCommand.StringVar(&conf.TencentSecretId, "tencent.secret_id", "", "Tencent Secret Id, default to use env COS_SECRETID")
remoteConfigureCommand.StringVar(&conf.TencentSecretKey, "tencent.secret_key", "", "Tencent secret key, default to use env COS_SECRETKEY")
remoteConfigureCommand.StringVar(&conf.TencentEndpoint, "tencent.endpoint", "", "Tencent endpoint")
- remoteConfigureCommand.StringVar(&conf.TencentRegion, "tencent.region", "", "Tencent region")
remoteConfigureCommand.StringVar(&conf.BaiduAccessKey, "baidu.access_key", "", "Baidu access key, default to use env BDCLOUD_ACCESS_KEY")
remoteConfigureCommand.StringVar(&conf.BaiduSecretKey, "baidu.secret_key", "", "Baidu secret key, default to use env BDCLOUD_SECRET_KEY")
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)