docs: fix rc docs and update anchors for new Hugo version

This commit is contained in:
Nick Craig-Wood 2020-05-17 11:44:34 +01:00
parent 038648aaca
commit 2bd786a452
2 changed files with 193 additions and 92 deletions

View file

@ -290,11 +290,11 @@ func list(ctx context.Context) error {
if !ok {
return errors.New("bad JSON")
}
fmt.Printf("### %s: %s {#%s}\n\n", info["Path"], info["Title"], info["Path"])
fmt.Printf("### %s: %s {#%s}\n\n", info["Path"], info["Title"], strings.Replace(info["Path"].(string), "/", "-", -1))
fmt.Printf("%s\n\n", info["Help"])
if authRequired := info["AuthRequired"]; authRequired != nil {
if authRequired.(bool) {
fmt.Printf("Authentication is required for this call.\n\n")
fmt.Printf("**Authentication is required for this call.**\n\n")
}
}
}

View file

@ -1,19 +1,16 @@
---
title: "Remote Control"
description: "Remote controlling rclone"
date: "2018-03-05"
title: "Remote Control / API"
description: "Remote controlling rclone with its API"
date: "2020-05-17"
---
# Remote controlling rclone #
# Remote controlling rclone with its API
If rclone is run with the `--rc` flag then it starts an http server
which can be used to remote control rclone.
which can be used to remote control rclone using its API.
If you just want to run a remote control then see the [rcd command](/commands/rclone_rcd/).
**NB** this is experimental and everything here is subject to change!
## Supported parameters
### --rc
@ -279,7 +276,53 @@ $ rclone rc --json '{ "group": "job/1" }' core/stats
## Supported commands
<!--- autogenerated start - run make rcdocs - don't edit here -->
### cache/expire: Purge a remote from cache {#cache/expire}
### backend/command: Runs a backend command. {#backend-command}
This takes the following parameters
- command - a string with the command name
- fs - a remote name string eg "drive:"
- arg - a list of arguments for the backend command
- opt - a map of string to string of options
Returns
- result - result from the backend command
For example
rclone rc backend/command command=noop fs=. -o echo=yes -o blue -a path1 -a path2
Returns
```
{
"result": {
"arg": [
"path1",
"path2"
],
"name": "noop",
"opt": {
"blue": "",
"echo": "yes"
}
}
}
```
Note that this is the direct equivalent of using this "backend"
command:
rclone backend noop . -o echo=yes -o blue path1 path2
Note that arguments must be preceeded by the "-a" flag
See the [backend](/commands/rclone_backend/) command for more information.
**Authentication is required for this call.**
### cache/expire: Purge a remote from cache {#cache-expire}
Purge a remote from the cache backend. Supports either a directory or a file.
Params:
@ -291,7 +334,7 @@ Eg
rclone rc cache/expire remote=path/to/sub/folder/
rclone rc cache/expire remote=/ withData=true
### cache/fetch: Fetch file chunks {#cache/fetch}
### cache/fetch: Fetch file chunks {#cache-fetch}
Ensure the specified file chunks are cached on disk.
@ -318,24 +361,26 @@ specify files to fetch, eg
File names will automatically be encrypted when the a crypt remote
is used on top of the cache.
### cache/stats: Get cache stats {#cache/stats}
### cache/stats: Get cache stats {#cache-stats}
Show statistics for the cache remote.
### config/create: create the config for a remote. {#config/create}
### config/create: create the config for a remote. {#config-create}
This takes the following parameters
- name - name of remote
- parameters - a map of \{ "key": "value" \} pairs
- type - type of the new remote
- obscure - optional bool - forces obscuring of passwords
- noObscure - optional bool - forces passwords not to be obscured
See the [config create command](/commands/rclone_config_create/) command for more information on the above.
Authentication is required for this call.
**Authentication is required for this call.**
### config/delete: Delete a remote in the config file. {#config/delete}
### config/delete: Delete a remote in the config file. {#config-delete}
Parameters:
@ -343,9 +388,9 @@ Parameters:
See the [config delete command](/commands/rclone_config_delete/) command for more information on the above.
Authentication is required for this call.
**Authentication is required for this call.**
### config/dump: Dumps the config file. {#config/dump}
### config/dump: Dumps the config file. {#config-dump}
Returns a JSON object:
- key: value
@ -354,9 +399,9 @@ Where keys are remote names and values are the config parameters.
See the [config dump command](/commands/rclone_config_dump/) command for more information on the above.
Authentication is required for this call.
**Authentication is required for this call.**
### config/get: Get a remote in the config file. {#config/get}
### config/get: Get a remote in the config file. {#config-get}
Parameters:
@ -364,18 +409,18 @@ Parameters:
See the [config dump command](/commands/rclone_config_dump/) command for more information on the above.
Authentication is required for this call.
**Authentication is required for this call.**
### config/listremotes: Lists the remotes in the config file. {#config/listremotes}
### config/listremotes: Lists the remotes in the config file. {#config-listremotes}
Returns
- remotes - array of remote names
See the [listremotes command](/commands/rclone_listremotes/) command for more information on the above.
Authentication is required for this call.
**Authentication is required for this call.**
### config/password: password the config for a remote. {#config/password}
### config/password: password the config for a remote. {#config-password}
This takes the following parameters
@ -385,30 +430,32 @@ This takes the following parameters
See the [config password command](/commands/rclone_config_password/) command for more information on the above.
Authentication is required for this call.
**Authentication is required for this call.**
### config/providers: Shows how providers are configured in the config file. {#config/providers}
### config/providers: Shows how providers are configured in the config file. {#config-providers}
Returns a JSON object:
- providers - array of objects
See the [config providers command](/commands/rclone_config_providers/) command for more information on the above.
Authentication is required for this call.
**Authentication is required for this call.**
### config/update: update the config for a remote. {#config/update}
### config/update: update the config for a remote. {#config-update}
This takes the following parameters
- name - name of remote
- parameters - a map of \{ "key": "value" \} pairs
- obscure - optional bool - forces obscuring of passwords
- noObscure - optional bool - forces passwords not to be obscured
See the [config update command](/commands/rclone_config_update/) command for more information on the above.
Authentication is required for this call.
**Authentication is required for this call.**
### core/bwlimit: Set the bandwidth limit. {#core/bwlimit}
### core/bwlimit: Set the bandwidth limit. {#core-bwlimit}
This sets the bandwidth limit to that passed in.
@ -440,13 +487,13 @@ except only one bandwidth may be specified.
In either case "rate" is returned as a human readable string, and
"bytesPerSecond" is returned as a number.
### core/gc: Runs a garbage collection. {#core/gc}
### core/gc: Runs a garbage collection. {#core-gc}
This tells the go runtime to do a garbage collection run. It isn't
necessary to call this normally, but it can be useful for debugging
memory problems.
### core/group-list: Returns list of stats. {#core/group-list}
### core/group-list: Returns list of stats. {#core-group-list}
This returns list of stats groups currently in memory.
@ -462,7 +509,7 @@ Returns the following values:
}
```
### core/memstats: Returns the memory statistics {#core/memstats}
### core/memstats: Returns the memory statistics {#core-memstats}
This returns the memory statistics of the running program. What the values mean
are explained in the go docs: https://golang.org/pkg/runtime/#MemStats
@ -474,7 +521,7 @@ The most interesting values for most people are:
* Sys: this is the total amount of memory requested from the OS
* It is virtual memory so may include unused memory
### core/obscure: Obscures a string passed in. {#core/obscure}
### core/obscure: Obscures a string passed in. {#core-obscure}
Pass a clear string and rclone will obscure it for the config file:
- clear - string
@ -482,17 +529,17 @@ Pass a clear string and rclone will obscure it for the config file:
Returns
- obscured - string
### core/pid: Return PID of current process {#core/pid}
### core/pid: Return PID of current process {#core-pid}
This returns PID of current process.
Useful for stopping rclone process.
### core/quit: Terminates the app. {#core/quit}
### core/quit: Terminates the app. {#core-quit}
(optional) Pass an exit code to be used for terminating the app:
- exitCode - int
### core/stats: Returns stats about current transfers. {#core/stats}
### core/stats: Returns stats about current transfers. {#core-stats}
This returns all available stats:
@ -517,6 +564,7 @@ Returns the following values:
"checks": number of checked files,
"transfers": number of transferred files,
"deletes" : number of deleted files,
"renames" : number of renamed files,
"elapsedTime": time in seconds since the start of the process,
"lastError": last occurred error,
"transferring": an array of currently active file transfers:
@ -538,7 +586,7 @@ Returns the following values:
Values for "transferring", "checking" and "lastError" are only assigned if data is available.
The value for "eta" is null if an eta cannot be determined.
### core/stats-delete: Delete stats group. {#core/stats-delete}
### core/stats-delete: Delete stats group. {#core-stats-delete}
This deletes entire stats group
@ -546,7 +594,7 @@ Parameters
- group - name of the stats group (string)
### core/stats-reset: Reset stats. {#core/stats-reset}
### core/stats-reset: Reset stats. {#core-stats-reset}
This clears counters, errors and finished transfers for all stats or specific
stats group if group is provided.
@ -555,7 +603,7 @@ Parameters
- group - name of the stats group (string)
### core/transferred: Returns stats about completed transfers. {#core/transferred}
### core/transferred: Returns stats about completed transfers. {#core-transferred}
This returns stats about completed transfers:
@ -588,7 +636,7 @@ Returns the following values:
}
```
### core/version: Shows the current version of rclone and the go runtime. {#core/version}
### core/version: Shows the current version of rclone and the go runtime. {#core-version}
This shows the current version of go and the go runtime
@ -600,7 +648,7 @@ This shows the current version of go and the go runtime
- arch - cpu architecture in use according to Go
- goVersion - version of Go runtime in use
### debug/set-block-profile-rate: Set runtime.SetBlockProfileRate for blocking profiling. {#debug/set-block-profile-rate}
### debug/set-block-profile-rate: Set runtime.SetBlockProfileRate for blocking profiling. {#debug-set-block-profile-rate}
SetBlockProfileRate controls the fraction of goroutine blocking events
that are reported in the blocking profile. The profiler aims to sample
@ -617,7 +665,7 @@ Parameters
- rate - int
### debug/set-mutex-profile-fraction: Set runtime.SetMutexProfileFraction for mutex profiling. {#debug/set-mutex-profile-fraction}
### debug/set-mutex-profile-fraction: Set runtime.SetMutexProfileFraction for mutex profiling. {#debug-set-mutex-profile-fraction}
SetMutexProfileFraction controls the fraction of mutex contention
events that are reported in the mutex profile. On average 1/rate
@ -638,7 +686,7 @@ Results
- previousRate - int
### job/list: Lists the IDs of the running jobs {#job/list}
### job/list: Lists the IDs of the running jobs {#job-list}
Parameters - None
@ -646,7 +694,7 @@ Results
- jobids - array of integer job ids
### job/status: Reads the status of the job ID {#job/status}
### job/status: Reads the status of the job ID {#job-status}
Parameters
@ -665,13 +713,66 @@ Results
- output - output of the job as would have been returned if called synchronously
- progress - output of the progress related to the underlying job
### job/stop: Stop the running job {#job/stop}
### job/stop: Stop the running job {#job-stop}
Parameters
- jobid - id of the job (integer)
### operations/about: Return the space used on the remote {#operations/about}
### mount/mount: Create a new mount point {#mount-mount}
rclone allows Linux, FreeBSD, macOS and Windows to mount any of
Rclone's cloud storage systems as a file system with FUSE.
If no mountType is provided, the priority is given as follows: 1. mount 2.cmount 3.mount2
This takes the following parameters
- fs - a remote path to be mounted (required)
- mountPoint: valid path on the local machine (required)
- mountType: One of the values (mount, cmount, mount2) specifies the mount implementation to use
Eg
rclone rc mount/mount fs=mydrive: mountPoint=/home/<user>/mountPoint
rclone rc mount/mount fs=mydrive: mountPoint=/home/<user>/mountPoint mountType=mount
**Authentication is required for this call.**
### mount/types: Show all possible mount types {#mount-types}
This shows all possible mount types and returns them as a list.
This takes no parameters and returns
- mountTypes: list of mount types
The mount types are strings like "mount", "mount2", "cmount" and can
be passed to mount/mount as the mountType parameter.
Eg
rclone rc mount/types
**Authentication is required for this call.**
### mount/unmount: Unmount all active mounts {#mount-unmount}
rclone allows Linux, FreeBSD, macOS and Windows to
mount any of Rclone's cloud storage systems as a file system with
FUSE.
This takes the following parameters
- mountPoint: valid path on the local machine where the mount was created (required)
Eg
rclone rc mount/unmount mountPoint=/home/<user>/mountPoint
**Authentication is required for this call.**
### operations/about: Return the space used on the remote {#operations-about}
This takes the following parameters
@ -681,9 +782,9 @@ The result is as returned from rclone about --json
See the [about command](/commands/rclone_size/) command for more information on the above.
Authentication is required for this call.
**Authentication is required for this call.**
### operations/cleanup: Remove trashed files in the remote or path {#operations/cleanup}
### operations/cleanup: Remove trashed files in the remote or path {#operations-cleanup}
This takes the following parameters
@ -691,9 +792,9 @@ This takes the following parameters
See the [cleanup command](/commands/rclone_cleanup/) command for more information on the above.
Authentication is required for this call.
**Authentication is required for this call.**
### operations/copyfile: Copy a file from source remote to destination remote {#operations/copyfile}
### operations/copyfile: Copy a file from source remote to destination remote {#operations-copyfile}
This takes the following parameters
@ -702,9 +803,9 @@ This takes the following parameters
- dstFs - a remote name string eg "drive2:" for the destination
- dstRemote - a path within that remote eg "file2.txt" for the destination
Authentication is required for this call.
**Authentication is required for this call.**
### operations/copyurl: Copy the URL to the object {#operations/copyurl}
### operations/copyurl: Copy the URL to the object {#operations-copyurl}
This takes the following parameters
@ -714,9 +815,9 @@ This takes the following parameters
- autoFilename - boolean, set to true to retrieve destination file name from url
See the [copyurl command](/commands/rclone_copyurl/) command for more information on the above.
Authentication is required for this call.
**Authentication is required for this call.**
### operations/delete: Remove files in the path {#operations/delete}
### operations/delete: Remove files in the path {#operations-delete}
This takes the following parameters
@ -724,9 +825,9 @@ This takes the following parameters
See the [delete command](/commands/rclone_delete/) command for more information on the above.
Authentication is required for this call.
**Authentication is required for this call.**
### operations/deletefile: Remove the single file pointed to {#operations/deletefile}
### operations/deletefile: Remove the single file pointed to {#operations-deletefile}
This takes the following parameters
@ -735,9 +836,9 @@ This takes the following parameters
See the [deletefile command](/commands/rclone_deletefile/) command for more information on the above.
Authentication is required for this call.
**Authentication is required for this call.**
### operations/fsinfo: Return information about the remote {#operations/fsinfo}
### operations/fsinfo: Return information about the remote {#operations-fsinfo}
This takes the following parameters
@ -794,7 +895,7 @@ This command does not have a command line equivalent so use this instead:
rclone rc --loopback operations/fsinfo fs=remote:
### operations/list: List the given remote and path in JSON format {#operations/list}
### operations/list: List the given remote and path in JSON format {#operations-list}
This takes the following parameters
@ -814,9 +915,9 @@ The result is
See the [lsjson command](/commands/rclone_lsjson/) for more information on the above and examples.
Authentication is required for this call.
**Authentication is required for this call.**
### operations/mkdir: Make a destination directory or container {#operations/mkdir}
### operations/mkdir: Make a destination directory or container {#operations-mkdir}
This takes the following parameters
@ -825,9 +926,9 @@ This takes the following parameters
See the [mkdir command](/commands/rclone_mkdir/) command for more information on the above.
Authentication is required for this call.
**Authentication is required for this call.**
### operations/movefile: Move a file from source remote to destination remote {#operations/movefile}
### operations/movefile: Move a file from source remote to destination remote {#operations-movefile}
This takes the following parameters
@ -836,9 +937,9 @@ This takes the following parameters
- dstFs - a remote name string eg "drive2:" for the destination
- dstRemote - a path within that remote eg "file2.txt" for the destination
Authentication is required for this call.
**Authentication is required for this call.**
### operations/publiclink: Create or retrieve a public link to the given file or folder. {#operations/publiclink}
### operations/publiclink: Create or retrieve a public link to the given file or folder. {#operations-publiclink}
This takes the following parameters
@ -851,9 +952,9 @@ Returns
See the [link command](/commands/rclone_link/) command for more information on the above.
Authentication is required for this call.
**Authentication is required for this call.**
### operations/purge: Remove a directory or container and all of its contents {#operations/purge}
### operations/purge: Remove a directory or container and all of its contents {#operations-purge}
This takes the following parameters
@ -862,9 +963,9 @@ This takes the following parameters
See the [purge command](/commands/rclone_purge/) command for more information on the above.
Authentication is required for this call.
**Authentication is required for this call.**
### operations/rmdir: Remove an empty directory or container {#operations/rmdir}
### operations/rmdir: Remove an empty directory or container {#operations-rmdir}
This takes the following parameters
@ -873,9 +974,9 @@ This takes the following parameters
See the [rmdir command](/commands/rclone_rmdir/) command for more information on the above.
Authentication is required for this call.
**Authentication is required for this call.**
### operations/rmdirs: Remove all the empty directories in the path {#operations/rmdirs}
### operations/rmdirs: Remove all the empty directories in the path {#operations-rmdirs}
This takes the following parameters
@ -885,9 +986,9 @@ This takes the following parameters
See the [rmdirs command](/commands/rclone_rmdirs/) command for more information on the above.
Authentication is required for this call.
**Authentication is required for this call.**
### operations/size: Count the number of bytes and files in remote {#operations/size}
### operations/size: Count the number of bytes and files in remote {#operations-size}
This takes the following parameters
@ -900,14 +1001,14 @@ Returns
See the [size command](/commands/rclone_size/) command for more information on the above.
Authentication is required for this call.
**Authentication is required for this call.**
### options/blocks: List all the option blocks {#options/blocks}
### options/blocks: List all the option blocks {#options-blocks}
Returns
- options - a list of the options block names
### options/get: Get all the options {#options/get}
### options/get: Get all the options {#options-get}
Returns an object where keys are option block names and values are an
object with the current option values in.
@ -915,7 +1016,7 @@ object with the current option values in.
This shows the internal names of the option within rclone which should
map to the external options very easily with a few exceptions.
### options/set: Set an option {#options/set}
### options/set: Set an option {#options-set}
Parameters
@ -942,31 +1043,31 @@ And this sets NOTICE level logs (normal without -v)
rclone rc options/set --json '{"main": {"LogLevel": 6}}'
### rc/error: This returns an error {#rc/error}
### rc/error: This returns an error {#rc-error}
This returns an error with the input as part of its error string.
Useful for testing error handling.
### rc/list: List all the registered remote control commands {#rc/list}
### rc/list: List all the registered remote control commands {#rc-list}
This lists all the registered remote control commands as a JSON map in
the commands response.
### rc/noop: Echo the input to the output parameters {#rc/noop}
### rc/noop: Echo the input to the output parameters {#rc-noop}
This echoes the input parameters to the output parameters for testing
purposes. It can be used to check that rclone is still alive and to
check that parameter passing is working properly.
### rc/noopauth: Echo the input to the output parameters requiring auth {#rc/noopauth}
### rc/noopauth: Echo the input to the output parameters requiring auth {#rc-noopauth}
This echoes the input parameters to the output parameters for testing
purposes. It can be used to check that rclone is still alive and to
check that parameter passing is working properly.
Authentication is required for this call.
**Authentication is required for this call.**
### sync/copy: copy a directory from source remote to destination remote {#sync/copy}
### sync/copy: copy a directory from source remote to destination remote {#sync-copy}
This takes the following parameters
@ -976,9 +1077,9 @@ This takes the following parameters
See the [copy command](/commands/rclone_copy/) command for more information on the above.
Authentication is required for this call.
**Authentication is required for this call.**
### sync/move: move a directory from source remote to destination remote {#sync/move}
### sync/move: move a directory from source remote to destination remote {#sync-move}
This takes the following parameters
@ -989,9 +1090,9 @@ This takes the following parameters
See the [move command](/commands/rclone_move/) command for more information on the above.
Authentication is required for this call.
**Authentication is required for this call.**
### sync/sync: sync a directory from source remote to destination remote {#sync/sync}
### sync/sync: sync a directory from source remote to destination remote {#sync-sync}
This takes the following parameters
@ -1001,9 +1102,9 @@ This takes the following parameters
See the [sync command](/commands/rclone_sync/) command for more information on the above.
Authentication is required for this call.
**Authentication is required for this call.**
### vfs/forget: Forget files or directories in the directory cache. {#vfs/forget}
### vfs/forget: Forget files or directories in the directory cache. {#vfs-forget}
This forgets the paths in the directory cache causing them to be
re-read from the remote when needed.
@ -1019,7 +1120,7 @@ starting with dir will forget that dir, eg
rclone rc vfs/forget file=hello file2=goodbye dir=home/junk
### vfs/poll-interval: Get the status or update the value of the poll-interval option. {#vfs/poll-interval}
### vfs/poll-interval: Get the status or update the value of the poll-interval option. {#vfs-poll-interval}
Without any parameter given this returns the current status of the
poll-interval setting.
@ -1041,7 +1142,7 @@ If poll-interval is updated or disabled temporarily, some changes
might not get picked up by the polling function, depending on the
used remote.
### vfs/refresh: Refresh the directory cache. {#vfs/refresh}
### vfs/refresh: Refresh the directory cache. {#vfs-refresh}
This reads the directories for the specified paths and freshens the
directory cache.