diff --git a/Mount-Remote-Storage.md b/Mount-Remote-Storage.md index 143c198..5c63040 100644 --- a/Mount-Remote-Storage.md +++ b/Mount-Remote-Storage.md @@ -3,6 +3,15 @@ After [[Configure Remote Storage]], you will get a storage name `cloud1`. ## Mount a Remote Storage Now you can run `remote.mount` in `weed shell`: ``` +> remote.mount -h +Usage of remote.mount: + -dir string + a directory in filer + -nonempty + allows the mounting over a non-empty directory + -remote string + a directory in remote storage, ex. //path/to/dir + > help remote.mount remote.mount # mount remote storage and pull its metadata @@ -27,6 +36,17 @@ This operation will pull down all metadata from the remote storage. Later, any metadata operations can be invoked locally, and respond very fast. +`unmount` will drop all local metadata and cached file content. + +### Repeatedly Update Metadata +Sometimes the data on the cloud has changed and local metadata becomes stale. To `unmount` first and `mount` again is costly since all data has to be cached again. To refresh the metadata changes, you can simply re-run the same command with `-nonempty` option, e.g.: +``` + remote.mount -dir=xxx -remote=cloud1/bucket -nonempty +``` +This will update local metadata accordingly and still keep file contents that are not changed. + +If the data on the cloud is changed often, you can add this command to the admin scripts defined in `master.toml`, to run it regularly. + ## Write Back changes to Remote Storage If the mounted directory is only for reading, you can start to use it.