mirror of
https://github.com/rclone/rclone.git
synced 2024-11-22 15:30:06 +08:00
docs: fix markup of arguments #4276
Command line arguments have to be marked as code.
This commit is contained in:
parent
35b2ca642c
commit
cd075f1703
|
@ -6,6 +6,7 @@ import (
|
|||
"io/ioutil"
|
||||
"log"
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
"github.com/rclone/rclone/cmd"
|
||||
"github.com/rclone/rclone/fs/config/flags"
|
||||
|
@ -35,7 +36,8 @@ func init() {
|
|||
var commandDefinition = &cobra.Command{
|
||||
Use: "cat remote:path",
|
||||
Short: `Concatenates any files and sends them to stdout.`,
|
||||
Long: `
|
||||
// Warning! "|" will be replaced by backticks below
|
||||
Long: strings.ReplaceAll(`
|
||||
rclone cat sends any files to standard output.
|
||||
|
||||
You can use it like this to output a single file
|
||||
|
@ -50,11 +52,11 @@ Or like this to output any .txt files in dir or its subdirectories.
|
|||
|
||||
rclone --include "*.txt" cat remote:path/to/dir
|
||||
|
||||
Use the --head flag to print characters only at the start, --tail for
|
||||
the end and --offset and --count to print a section in the middle.
|
||||
Use the |--head| flag to print characters only at the start, |--tail| for
|
||||
the end and |--offset| and |--count| to print a section in the middle.
|
||||
Note that if offset is negative it will count from the end, so
|
||||
--offset -1 --count 1 is equivalent to --tail 1.
|
||||
`,
|
||||
|--offset -1 --count 1| is equivalent to |--tail 1|.
|
||||
`, "|", "`"),
|
||||
Run: func(command *cobra.Command, args []string) {
|
||||
usedOffset := offset != 0 || count >= 0
|
||||
usedHead := head > 0
|
||||
|
|
|
@ -45,7 +45,8 @@ func AddFlags(cmdFlags *pflag.FlagSet) {
|
|||
}
|
||||
|
||||
// FlagsHelp describes the flags for the help
|
||||
var FlagsHelp = strings.Replace(`
|
||||
// Warning! "|" will be replaced by backticks below
|
||||
var FlagsHelp = strings.ReplaceAll(`
|
||||
If you supply the |--one-way| flag, it will only check that files in
|
||||
the source match the files in the destination, not the other way
|
||||
around. This means that extra files in the destination that are not in
|
||||
|
@ -66,7 +67,7 @@ you what happened to it. These are reminiscent of diff files.
|
|||
- |+ path| means path was missing on the destination, so only in the source
|
||||
- |* path| means path was present in source and destination but different.
|
||||
- |! path| means there was an error reading or hashing the source or dest.
|
||||
`, "|", "`", -1)
|
||||
`, "|", "`")
|
||||
|
||||
// GetCheckOpt gets the options corresponding to the check flags
|
||||
func GetCheckOpt(fsrc, fdst fs.Fs) (opt *operations.CheckOpt, close func(), err error) {
|
||||
|
@ -130,19 +131,19 @@ func GetCheckOpt(fsrc, fdst fs.Fs) (opt *operations.CheckOpt, close func(), err
|
|||
var commandDefinition = &cobra.Command{
|
||||
Use: "check source:path dest:path",
|
||||
Short: `Checks the files in the source and destination match.`,
|
||||
Long: `
|
||||
Long: strings.ReplaceAll(`
|
||||
Checks the files in the source and destination match. It compares
|
||||
sizes and hashes (MD5 or SHA1) and logs a report of files which don't
|
||||
match. It doesn't alter the source or destination.
|
||||
|
||||
If you supply the --size-only flag, it will only compare the sizes not
|
||||
If you supply the |--size-only| flag, it will only compare the sizes not
|
||||
the hashes as well. Use this for a quick check.
|
||||
|
||||
If you supply the --download flag, it will download the data from
|
||||
If you supply the |--download| flag, it will download the data from
|
||||
both remotes and check them against each other on the fly. This can
|
||||
be useful for remotes that don't support hashes or if you really want
|
||||
to check all the data.
|
||||
` + FlagsHelp,
|
||||
`, "|", "`") + FlagsHelp,
|
||||
Run: func(command *cobra.Command, args []string) {
|
||||
cmd.CheckArgs(2, 2, command, args)
|
||||
fsrc, fdst := cmd.NewFsSrcDst(args)
|
||||
|
|
|
@ -2,6 +2,7 @@ package copy
|
|||
|
||||
import (
|
||||
"context"
|
||||
"strings"
|
||||
|
||||
"github.com/rclone/rclone/cmd"
|
||||
"github.com/rclone/rclone/fs/config/flags"
|
||||
|
@ -23,7 +24,8 @@ func init() {
|
|||
var commandDefinition = &cobra.Command{
|
||||
Use: "copy source:path dest:path",
|
||||
Short: `Copy files from source to dest, skipping already copied.`,
|
||||
Long: `
|
||||
// Note: "|" will be replaced by backticks below
|
||||
Long: strings.ReplaceAll(`
|
||||
Copy the source to the destination. Doesn't transfer
|
||||
unchanged files, testing by size and modification time or
|
||||
MD5SUM. Doesn't delete files from the destination.
|
||||
|
@ -55,8 +57,8 @@ Not to
|
|||
destpath/sourcepath/one.txt
|
||||
destpath/sourcepath/two.txt
|
||||
|
||||
If you are familiar with ` + "`rsync`" + `, rclone always works as if you had
|
||||
written a trailing / - meaning "copy the contents of this directory".
|
||||
If you are familiar with |rsync|, rclone always works as if you had
|
||||
written a trailing |/| - meaning "copy the contents of this directory".
|
||||
This applies to all commands and whether you are talking about the
|
||||
source or destination.
|
||||
|
||||
|
@ -71,10 +73,10 @@ recently very efficiently like this:
|
|||
|
||||
rclone copy --max-age 24h --no-traverse /path/to/src remote:
|
||||
|
||||
**Note**: Use the ` + "`-P`" + `/` + "`--progress`" + ` flag to view real-time transfer statistics.
|
||||
**Note**: Use the |-P|/|--progress| flag to view real-time transfer statistics.
|
||||
|
||||
**Note**: Use the ` + "`--dry-run` or the `--interactive`/`-i`" + ` flag to test without copying anything.
|
||||
`,
|
||||
**Note**: Use the |--dry-run| or the |--interactive|/|-i| flag to test without copying anything.
|
||||
`, "|", "`"),
|
||||
Run: func(command *cobra.Command, args []string) {
|
||||
cmd.CheckArgs(2, 2, command, args)
|
||||
fsrc, srcFileName, fdst := cmd.NewFsSrcFileDst(args)
|
||||
|
|
|
@ -2,6 +2,7 @@ package delete
|
|||
|
||||
import (
|
||||
"context"
|
||||
"strings"
|
||||
|
||||
"github.com/rclone/rclone/cmd"
|
||||
"github.com/rclone/rclone/fs/config/flags"
|
||||
|
@ -22,16 +23,17 @@ func init() {
|
|||
var commandDefinition = &cobra.Command{
|
||||
Use: "delete remote:path",
|
||||
Short: `Remove the files in path.`,
|
||||
Long: `
|
||||
Remove the files in path. Unlike ` + "`" + `purge` + "`" + ` it obeys include/exclude
|
||||
// Warning! "|" will be replaced by backticks below
|
||||
Long: strings.ReplaceAll(`
|
||||
Remove the files in path. Unlike |purge| it obeys include/exclude
|
||||
filters so can be used to selectively delete files.
|
||||
|
||||
` + "`rclone delete`" + ` only deletes files but leaves the directory structure
|
||||
|rclone delete| only deletes files but leaves the directory structure
|
||||
alone. If you want to delete a directory and all of its contents use
|
||||
the ` + "`purge`" + ` command.
|
||||
the |purge| command.
|
||||
|
||||
If you supply the --rmdirs flag, it will remove all empty directories along with it.
|
||||
You can also use the separate command ` + "`rmdir`" + ` or ` + "`rmdirs`" + ` to
|
||||
If you supply the |--rmdirs| flag, it will remove all empty directories along with it.
|
||||
You can also use the separate command |rmdir| or |rmdirs| to
|
||||
delete empty directories only.
|
||||
|
||||
For example, to delete all files bigger than 100MBytes, you may first want to check what
|
||||
|
@ -48,8 +50,8 @@ That reads "delete everything with a minimum size of 100 MB", hence
|
|||
delete all files bigger than 100MBytes.
|
||||
|
||||
**Important**: Since this can cause data loss, test first with the
|
||||
` + "`--dry-run` or the `--interactive`/`-i`" + ` flag.
|
||||
`,
|
||||
|--dry-run| or the |--interactive|/|-i| flag.
|
||||
`, "|", "`"),
|
||||
Run: func(command *cobra.Command, args []string) {
|
||||
cmd.CheckArgs(1, 1, command, args)
|
||||
fsrc := cmd.NewFsSrc(args)
|
||||
|
|
|
@ -1,26 +1,31 @@
|
|||
package lshelp
|
||||
|
||||
import (
|
||||
"strings"
|
||||
)
|
||||
|
||||
// Help describes the common help for all the list commands
|
||||
var Help = `
|
||||
// Warning! "|" will be replaced by backticks below
|
||||
var Help = strings.ReplaceAll(`
|
||||
Any of the filtering options can be applied to this command.
|
||||
|
||||
There are several related list commands
|
||||
|
||||
* ` + "`ls`" + ` to list size and path of objects only
|
||||
* ` + "`lsl`" + ` to list modification time, size and path of objects only
|
||||
* ` + "`lsd`" + ` to list directories only
|
||||
* ` + "`lsf`" + ` to list objects and directories in easy to parse format
|
||||
* ` + "`lsjson`" + ` to list objects and directories in JSON format
|
||||
* |ls| to list size and path of objects only
|
||||
* |lsl| to list modification time, size and path of objects only
|
||||
* |lsd| to list directories only
|
||||
* |lsf| to list objects and directories in easy to parse format
|
||||
* |lsjson| to list objects and directories in JSON format
|
||||
|
||||
` + "`ls`,`lsl`,`lsd`" + ` are designed to be human readable.
|
||||
` + "`lsf`" + ` is designed to be human and machine readable.
|
||||
` + "`lsjson`" + ` is designed to be machine readable.
|
||||
|ls|,|lsl|,|lsd| are designed to be human readable.
|
||||
|lsf| is designed to be human and machine readable.
|
||||
|lsjson| is designed to be machine readable.
|
||||
|
||||
Note that ` + "`ls` and `lsl`" + ` recurse by default - use "--max-depth 1" to stop the recursion.
|
||||
Note that |ls| and |lsl| recurse by default - use |--max-depth 1| to stop the recursion.
|
||||
|
||||
The other list commands ` + "`lsd`,`lsf`,`lsjson`" + ` do not recurse by default - use "-R" to make them recurse.
|
||||
The other list commands |lsd|,|lsf|,|lsjson| do not recurse by default - use |-R| to make them recurse.
|
||||
|
||||
Listing a non existent directory will produce an error except for
|
||||
remotes which can't have empty directories (e.g. s3, swift, or gcs -
|
||||
the bucket based remotes).
|
||||
`
|
||||
`, "|", "`")
|
||||
|
|
|
@ -159,34 +159,36 @@ func NewMountCommand(commandName string, hidden bool, mount MountFn) *cobra.Comm
|
|||
Use: commandName + " remote:path /path/to/mountpoint",
|
||||
Hidden: hidden,
|
||||
Short: `Mount the remote as file system on a mountpoint.`,
|
||||
Long: `
|
||||
rclone ` + commandName + ` allows Linux, FreeBSD, macOS and Windows to
|
||||
// Warning! "|" will be replaced by backticks below
|
||||
// "@" will be replaced by the command name
|
||||
Long: strings.ReplaceAll(strings.ReplaceAll(`
|
||||
rclone @ allows Linux, FreeBSD, macOS and Windows to
|
||||
mount any of Rclone's cloud storage systems as a file system with
|
||||
FUSE.
|
||||
|
||||
First set up your remote using ` + "`rclone config`" + `. Check it works with ` + "`rclone ls`" + ` etc.
|
||||
First set up your remote using |rclone config|. Check it works with |rclone ls| etc.
|
||||
|
||||
On Linux and OSX, you can either run mount in foreground mode or background (daemon) mode.
|
||||
Mount runs in foreground mode by default, use the ` + "`--daemon`" + ` flag to specify background mode.
|
||||
Mount runs in foreground mode by default, use the |--daemon| flag to specify background mode.
|
||||
You can only run mount in foreground mode on Windows.
|
||||
|
||||
On Linux/macOS/FreeBSD start the mount like this, where ` + "`/path/to/local/mount`" + `
|
||||
On Linux/macOS/FreeBSD start the mount like this, where |/path/to/local/mount|
|
||||
is an **empty** **existing** directory:
|
||||
|
||||
rclone ` + commandName + ` remote:path/to/files /path/to/local/mount
|
||||
rclone @ remote:path/to/files /path/to/local/mount
|
||||
|
||||
On Windows you can start a mount in different ways. See [below](#mounting-modes-on-windows)
|
||||
for details. The following examples will mount to an automatically assigned drive,
|
||||
to specific drive letter ` + "`X:`" + `, to path ` + "`C:\\path\\to\\nonexistent\\directory`" + `
|
||||
to specific drive letter |X:|, to path |C:\path\to\nonexistent\directory|
|
||||
(which must be **non-existent** subdirectory of an **existing** parent directory or drive,
|
||||
and is not supported when [mounting as a network drive](#mounting-modes-on-windows)), and
|
||||
the last example will mount as network share ` + "`\\cloud\remote`" + ` and map it to an
|
||||
the last example will mount as network share |\\cloud\remote| and map it to an
|
||||
automatically assigned drive:
|
||||
|
||||
rclone ` + commandName + ` remote:path/to/files *
|
||||
rclone ` + commandName + ` remote:path/to/files X:
|
||||
rclone ` + commandName + ` remote:path/to/files C:\path\to\nonexistent\directory
|
||||
rclone ` + commandName + ` remote:path/to/files \\cloud\remote
|
||||
rclone @ remote:path/to/files *
|
||||
rclone @ remote:path/to/files X:
|
||||
rclone @ remote:path/to/files C:\path\to\nonexistent\directory
|
||||
rclone @ remote:path/to/files \\cloud\remote
|
||||
|
||||
When the program ends while in foreground mode, either via Ctrl+C or receiving
|
||||
a SIGINT or SIGTERM signal, the mount should be automatically stopped.
|
||||
|
@ -208,12 +210,12 @@ then an additional 1PB of free space is assumed. If the remote does not
|
|||
[support](https://rclone.org/overview/#optional-features) the about feature
|
||||
at all, then 1PB is set as both the total and the free size.
|
||||
|
||||
**Note**: As of ` + "`rclone` 1.52.2, `rclone mount`" + ` now requires Go version 1.13
|
||||
**Note**: As of |rclone| 1.52.2, |rclone mount| now requires Go version 1.13
|
||||
or newer on some platforms depending on the underlying FUSE library in use.
|
||||
|
||||
### Installing on Windows
|
||||
|
||||
To run rclone ` + commandName + ` on Windows, you will need to
|
||||
To run rclone @ on Windows, you will need to
|
||||
download and install [WinFsp](http://www.secfs.net/winfsp/).
|
||||
|
||||
[WinFsp](https://github.com/billziss-gh/winfsp) is an open source
|
||||
|
@ -221,7 +223,7 @@ Windows File System Proxy which makes it easy to write user space file
|
|||
systems for Windows. It provides a FUSE emulation layer which rclone
|
||||
uses combination with [cgofuse](https://github.com/billziss-gh/cgofuse).
|
||||
Both of these packages are by Bill Zissimopoulos who was very helpful
|
||||
during the implementation of rclone ` + commandName + ` for Windows.
|
||||
during the implementation of rclone @ for Windows.
|
||||
|
||||
#### Mounting modes on windows
|
||||
|
||||
|
@ -240,54 +242,54 @@ as a network drive instead.
|
|||
|
||||
When mounting as a fixed disk drive you can either mount to an unused drive letter,
|
||||
or to a path - which must be **non-existent** subdirectory of an **existing** parent
|
||||
directory or drive. Using the special value ` + "`*`" + ` will tell rclone to
|
||||
directory or drive. Using the special value |*| will tell rclone to
|
||||
automatically assign the next available drive letter, starting with Z: and moving backward.
|
||||
Examples:
|
||||
|
||||
rclone ` + commandName + ` remote:path/to/files *
|
||||
rclone ` + commandName + ` remote:path/to/files X:
|
||||
rclone ` + commandName + ` remote:path/to/files C:\path\to\nonexistent\directory
|
||||
rclone ` + commandName + ` remote:path/to/files X:
|
||||
rclone @ remote:path/to/files *
|
||||
rclone @ remote:path/to/files X:
|
||||
rclone @ remote:path/to/files C:\path\to\nonexistent\directory
|
||||
rclone @ remote:path/to/files X:
|
||||
|
||||
Option ` + "`--volname`" + ` can be used to set a custom volume name for the mounted
|
||||
Option |--volname| can be used to set a custom volume name for the mounted
|
||||
file system. The default is to use the remote name and path.
|
||||
|
||||
To mount as network drive, you can add option ` + "`--network-mode`" + `
|
||||
to your ` + commandName + ` command. Mounting to a directory path is not supported in
|
||||
To mount as network drive, you can add option |--network-mode|
|
||||
to your @ command. Mounting to a directory path is not supported in
|
||||
this mode, it is a limitation Windows imposes on junctions, so the remote must always
|
||||
be mounted to a drive letter.
|
||||
|
||||
rclone ` + commandName + ` remote:path/to/files X: --network-mode
|
||||
rclone @ remote:path/to/files X: --network-mode
|
||||
|
||||
A volume name specified with ` + "`--volname`" + ` will be used to create the network share path.
|
||||
A complete UNC path, such as ` + "`\\\\cloud\\remote`" + `, optionally with path
|
||||
` + "`\\\\cloud\\remote\\madeup\\path`" + `, will be used as is. Any other
|
||||
string will be used as the share part, after a default prefix ` + "`\\\\server\\`" + `.
|
||||
If no volume name is specified then ` + "`\\\\server\\share`" + ` will be used.
|
||||
A volume name specified with |--volname| will be used to create the network share path.
|
||||
A complete UNC path, such as |\\cloud\remote|, optionally with path
|
||||
|\\cloud\remote\madeup\path|, will be used as is. Any other
|
||||
string will be used as the share part, after a default prefix |\\server\|.
|
||||
If no volume name is specified then |\\server\share| will be used.
|
||||
You must make sure the volume name is unique when you are mounting more than one drive,
|
||||
or else the mount command will fail. The share name will treated as the volume label for
|
||||
the mapped drive, shown in Windows Explorer etc, while the complete
|
||||
` + "`\\\\server\\share`" + ` will be reported as the remote UNC path by
|
||||
` + "`net use`" + ` etc, just like a normal network drive mapping.
|
||||
|\\server\share| will be reported as the remote UNC path by
|
||||
|net use| etc, just like a normal network drive mapping.
|
||||
|
||||
If you specify a full network share UNC path with ` + "`--volname`" + `, this will implicitely
|
||||
set the ` + "`--network-mode`" + ` option, so the following two examples have same result:
|
||||
If you specify a full network share UNC path with |--volname|, this will implicitely
|
||||
set the |--network-mode| option, so the following two examples have same result:
|
||||
|
||||
rclone ` + commandName + ` remote:path/to/files X: --network-mode
|
||||
rclone ` + commandName + ` remote:path/to/files X: --volname \\server\share
|
||||
rclone @ remote:path/to/files X: --network-mode
|
||||
rclone @ remote:path/to/files X: --volname \\server\share
|
||||
|
||||
You may also specify the network share UNC path as the mountpoint itself. Then rclone
|
||||
will automatically assign a drive letter, same as with ` + "`*`" + ` and use that as
|
||||
will automatically assign a drive letter, same as with |*| and use that as
|
||||
mountpoint, and instead use the UNC path specified as the volume name, as if it were
|
||||
specified with the ` + "`--volname`" + ` option. This will also implicitely set
|
||||
the ` + "`--network-mode`" + ` option. This means the following two examples have same result:
|
||||
specified with the |--volname| option. This will also implicitely set
|
||||
the |--network-mode| option. This means the following two examples have same result:
|
||||
|
||||
rclone ` + commandName + ` remote:path/to/files \\cloud\remote
|
||||
rclone ` + commandName + ` remote:path/to/files * --volname \\cloud\remote
|
||||
rclone @ remote:path/to/files \\cloud\remote
|
||||
rclone @ remote:path/to/files * --volname \\cloud\remote
|
||||
|
||||
There is yet another way to enable network mode, and to set the share path,
|
||||
and that is to pass the "native" libfuse/WinFsp option directly:
|
||||
` + "`--fuse-flag --VolumePrefix=\\server\\share`" + `. Note that the path
|
||||
|--fuse-flag --VolumePrefix=\server\share|. Note that the path
|
||||
must be with just a single backslash prefix in this case.
|
||||
|
||||
|
||||
|
@ -308,12 +310,12 @@ representing permissions for the POSIX permission scopes: Owner, group and other
|
|||
By default, the owner and group will be taken from the current user, and the built-in
|
||||
group "Everyone" will be used to represent others. The user/group can be customized
|
||||
with FUSE options "UserName" and "GroupName",
|
||||
e.g. ` + "`-o UserName=user123 -o GroupName=\"Authenticated Users\"`" + `.
|
||||
e.g. |-o UserName=user123 -o GroupName="Authenticated Users"|.
|
||||
|
||||
The permissions on each entry will be set according to
|
||||
[options](#options) ` + "`--dir-perms`" + ` and ` + "`--file-perms`" + `,
|
||||
[options](#options) |--dir-perms| and |--file-perms|,
|
||||
which takes a value in traditional [numeric notation](https://en.wikipedia.org/wiki/File-system_permissions#Numeric_notation),
|
||||
where the default corresponds to ` + "`--file-perms 0666 --dir-perms 0777`" + `.
|
||||
where the default corresponds to |--file-perms 0666 --dir-perms 0777|.
|
||||
|
||||
Note that the mapping of permissions is not always trivial, and the result
|
||||
you see in Windows Explorer may not be exactly like you expected.
|
||||
|
@ -342,10 +344,10 @@ alternatively using [the nssm service manager](https://nssm.cc/usage).
|
|||
|
||||
### Limitations
|
||||
|
||||
Without the use of ` + "`--vfs-cache-mode`" + ` this can only write files
|
||||
Without the use of |--vfs-cache-mode| this can only write files
|
||||
sequentially, it can only seek when reading. This means that many
|
||||
applications won't work with their files on an rclone mount without
|
||||
` + "`--vfs-cache-mode writes`" + ` or ` + "`--vfs-cache-mode full`" + `.
|
||||
|--vfs-cache-mode writes| or |--vfs-cache-mode full|.
|
||||
See the [File Caching](#file-caching) section for more info.
|
||||
|
||||
The bucket based remotes (e.g. Swift, S3, Google Compute Storage, B2,
|
||||
|
@ -355,21 +357,21 @@ the directory cache.
|
|||
|
||||
Only supported on Linux, FreeBSD, OS X and Windows at the moment.
|
||||
|
||||
### rclone ` + commandName + ` vs rclone sync/copy
|
||||
### rclone @ vs rclone sync/copy
|
||||
|
||||
File systems expect things to be 100% reliable, whereas cloud storage
|
||||
systems are a long way from 100% reliable. The rclone sync/copy
|
||||
commands cope with this with lots of retries. However rclone ` + commandName + `
|
||||
commands cope with this with lots of retries. However rclone @
|
||||
can't use retries in the same way without making local copies of the
|
||||
uploads. Look at the [file caching](#file-caching)
|
||||
for solutions to make ` + commandName + ` more reliable.
|
||||
for solutions to make @ more reliable.
|
||||
|
||||
### Attribute caching
|
||||
|
||||
You can use the flag ` + "`--attr-timeout`" + ` to set the time the kernel caches
|
||||
You can use the flag |--attr-timeout| to set the time the kernel caches
|
||||
the attributes (size, modification time, etc.) for directory entries.
|
||||
|
||||
The default is "1s" which caches files just long enough to avoid
|
||||
The default is |1s| which caches files just long enough to avoid
|
||||
too many callbacks to rclone from the kernel.
|
||||
|
||||
In theory 0s should be the correct value for filesystems which can
|
||||
|
@ -380,14 +382,14 @@ few problems such as
|
|||
and [excessive time listing directories](https://github.com/rclone/rclone/issues/2095#issuecomment-371141147).
|
||||
|
||||
The kernel can cache the info about a file for the time given by
|
||||
` + "`--attr-timeout`" + `. You may see corruption if the remote file changes
|
||||
|--attr-timeout|. You may see corruption if the remote file changes
|
||||
length during this window. It will show up as either a truncated file
|
||||
or a file with garbage on the end. With ` + "`--attr-timeout 1s`" + ` this is
|
||||
very unlikely but not impossible. The higher you set ` + "`--attr-timeout`" + `
|
||||
or a file with garbage on the end. With |--attr-timeout 1s| this is
|
||||
very unlikely but not impossible. The higher you set |--attr-timeout|
|
||||
the more likely it is. The default setting of "1s" is the lowest
|
||||
setting which mitigates the problems above.
|
||||
|
||||
If you set it higher ('10s' or '1m' say) then the kernel will call
|
||||
If you set it higher (|10s| or |1m| say) then the kernel will call
|
||||
back to rclone less often making it more efficient, however there is
|
||||
more chance of the corruption issue above.
|
||||
|
||||
|
@ -403,28 +405,28 @@ files to be visible in the mount.
|
|||
|
||||
### systemd
|
||||
|
||||
When running rclone ` + commandName + ` as a systemd service, it is possible
|
||||
When running rclone @ as a systemd service, it is possible
|
||||
to use Type=notify. In this case the service will enter the started state
|
||||
after the mountpoint has been successfully set up.
|
||||
Units having the rclone ` + commandName + ` service specified as a requirement
|
||||
Units having the rclone @ service specified as a requirement
|
||||
will see all files and folders immediately in this mode.
|
||||
|
||||
### chunked reading
|
||||
|
||||
` + "`--vfs-read-chunk-size`" + ` will enable reading the source objects in parts.
|
||||
|--vfs-read-chunk-size| will enable reading the source objects in parts.
|
||||
This can reduce the used download quota for some remotes by requesting only chunks
|
||||
from the remote that are actually read at the cost of an increased number of requests.
|
||||
|
||||
When ` + "`--vfs-read-chunk-size-limit`" + ` is also specified and greater than
|
||||
` + "`--vfs-read-chunk-size`" + `, the chunk size for each open file will get doubled
|
||||
for each chunk read, until the specified value is reached. A value of -1 will disable
|
||||
When |--vfs-read-chunk-size-limit| is also specified and greater than
|
||||
|--vfs-read-chunk-size|, the chunk size for each open file will get doubled
|
||||
for each chunk read, until the specified value is reached. A value of |-1| will disable
|
||||
the limit and the chunk size will grow indefinitely.
|
||||
|
||||
With ` + "`--vfs-read-chunk-size 100M`" + ` and ` + "`--vfs-read-chunk-size-limit 0`" + `
|
||||
With |--vfs-read-chunk-size 100M| and |--vfs-read-chunk-size-limit 0|
|
||||
the following parts will be downloaded: 0-100M, 100M-200M, 200M-300M, 300M-400M and so on.
|
||||
When ` + "`--vfs-read-chunk-size-limit 500M`" + ` is specified, the result would be
|
||||
When |--vfs-read-chunk-size-limit 500M| is specified, the result would be
|
||||
0-100M, 100M-300M, 300M-700M, 700M-1200M, 1200M-1700M and so on.
|
||||
` + vfs.Help,
|
||||
`, "|", "`"), "@", commandName) + vfs.Help,
|
||||
Run: func(command *cobra.Command, args []string) {
|
||||
cmd.CheckArgs(2, 2, command, args)
|
||||
opt := Opt // make a copy of the options
|
||||
|
|
|
@ -2,6 +2,7 @@ package move
|
|||
|
||||
import (
|
||||
"context"
|
||||
"strings"
|
||||
|
||||
"github.com/rclone/rclone/cmd"
|
||||
"github.com/rclone/rclone/fs/config/flags"
|
||||
|
@ -26,20 +27,21 @@ func init() {
|
|||
var commandDefinition = &cobra.Command{
|
||||
Use: "move source:path dest:path",
|
||||
Short: `Move files from source to dest.`,
|
||||
Long: `
|
||||
// Warning! "|" will be replaced by backticks below
|
||||
Long: strings.ReplaceAll(`
|
||||
Moves the contents of the source directory to the destination
|
||||
directory. Rclone will error if the source and destination overlap and
|
||||
the remote does not support a server-side directory move operation.
|
||||
|
||||
If no filters are in use and if possible this will server-side move
|
||||
` + "`source:path`" + ` into ` + "`dest:path`" + `. After this ` + "`source:path`" + ` will no
|
||||
|source:path| into |dest:path|. After this |source:path| will no
|
||||
longer exist.
|
||||
|
||||
Otherwise for each file in ` + "`source:path`" + ` selected by the filters (if
|
||||
any) this will move it into ` + "`dest:path`" + `. If possible a server-side
|
||||
Otherwise for each file in |source:path| selected by the filters (if
|
||||
any) this will move it into |dest:path|. If possible a server-side
|
||||
move will be used, otherwise it will copy it (server-side if possible)
|
||||
into ` + "`dest:path`" + ` then delete the original (if no errors on copy) in
|
||||
` + "`source:path`" + `.
|
||||
into |dest:path| then delete the original (if no errors on copy) in
|
||||
|source:path|.
|
||||
|
||||
If you want to delete empty source directories after move, use the --delete-empty-src-dirs flag.
|
||||
|
||||
|
@ -49,10 +51,10 @@ option when moving a small number of files into a large destination
|
|||
can speed transfers up greatly.
|
||||
|
||||
**Important**: Since this can cause data loss, test first with the
|
||||
` + "`--dry-run` or the `--interactive`/`-i`" + ` flag.
|
||||
|--dry-run| or the |--interactive|/|-i| flag.
|
||||
|
||||
**Note**: Use the ` + "`-P`" + `/` + "`--progress`" + ` flag to view real-time transfer statistics.
|
||||
`,
|
||||
**Note**: Use the |-P|/|--progress| flag to view real-time transfer statistics.
|
||||
`, "|", "`"),
|
||||
Run: func(command *cobra.Command, args []string) {
|
||||
cmd.CheckArgs(2, 2, command, args)
|
||||
fsrc, srcFileName, fdst := cmd.NewFsSrcFileDst(args)
|
||||
|
|
30
vfs/help.go
30
vfs/help.go
|
@ -1,8 +1,14 @@
|
|||
package vfs
|
||||
|
||||
import (
|
||||
"strings"
|
||||
)
|
||||
|
||||
// Help contains text describing file and directory caching to add to
|
||||
// the command help.
|
||||
var Help = `
|
||||
// Warning: "!" (sic) will be replaced by backticks below,
|
||||
// but the pipe character "|" can be used as is.
|
||||
var Help = strings.ReplaceAll(`
|
||||
### VFS - Virtual File System
|
||||
|
||||
This command uses the VFS layer. This adapts the cloud storage objects
|
||||
|
@ -19,7 +25,7 @@ about files and directories (but not the data) in memory.
|
|||
|
||||
### VFS Directory Cache
|
||||
|
||||
Using the ` + "`--dir-cache-time`" + ` flag, you can control how long a
|
||||
Using the !--dir-cache-time! flag, you can control how long a
|
||||
directory should be considered up to date and not refreshed from the
|
||||
backend. Changes made through the mount will appear immediately or
|
||||
invalidate the cache.
|
||||
|
@ -33,7 +39,7 @@ the directory cache expires if the backend configured does not support
|
|||
polling for changes. If the backend supports polling, changes will be
|
||||
picked up within the polling interval.
|
||||
|
||||
You can send a ` + "`SIGHUP`" + ` signal to rclone for it to flush all
|
||||
You can send a !SIGHUP! signal to rclone for it to flush all
|
||||
directory caches, regardless of how old they are. Assuming only one
|
||||
rclone instance is running, you can reset the cache like this:
|
||||
|
||||
|
@ -50,7 +56,7 @@ Or individual files or directories:
|
|||
|
||||
### VFS File Buffering
|
||||
|
||||
The ` + "`--buffer-size`" + ` flag determines the amount of memory,
|
||||
The !--buffer-size! flag determines the amount of memory,
|
||||
that will be used to buffer data in advance.
|
||||
|
||||
Each open file will try to keep the specified amount of data in memory
|
||||
|
@ -63,7 +69,7 @@ yet read. If the buffer is empty, only a small amount of memory will
|
|||
be used.
|
||||
|
||||
The maximum memory used by rclone for buffering can be up to
|
||||
` + "`--buffer-size * open files`" + `.
|
||||
!--buffer-size * open files!.
|
||||
|
||||
### VFS File Caching
|
||||
|
||||
|
@ -84,12 +90,12 @@ find that you need one or the other or both.
|
|||
--vfs-cache-poll-interval duration Interval to poll the cache for stale objects. (default 1m0s)
|
||||
--vfs-write-back duration Time to writeback files after last use when using cache. (default 5s)
|
||||
|
||||
If run with ` + "`-vv`" + ` rclone will print the location of the file cache. The
|
||||
If run with !-vv! rclone will print the location of the file cache. The
|
||||
files are stored in the user cache file area which is OS dependent but
|
||||
can be controlled with ` + "`--cache-dir`" + ` or setting the appropriate
|
||||
can be controlled with !--cache-dir! or setting the appropriate
|
||||
environment variable.
|
||||
|
||||
The cache has 4 different modes selected by ` + "`--vfs-cache-mode`" + `.
|
||||
The cache has 4 different modes selected by !--vfs-cache-mode!.
|
||||
The higher the cache mode the more compatible rclone becomes at the
|
||||
cost of using disk space.
|
||||
|
||||
|
@ -99,9 +105,9 @@ second. If rclone is quit or dies with files that haven't been
|
|||
uploaded, these will be uploaded next time rclone is run with the same
|
||||
flags.
|
||||
|
||||
If using --vfs-cache-max-size note that the cache may exceed this size
|
||||
If using !--vfs-cache-max-size! note that the cache may exceed this size
|
||||
for two reasons. Firstly because it is only checked every
|
||||
--vfs-cache-poll-interval. Secondly because open files cannot be
|
||||
!--vfs-cache-poll-interval!. Secondly because open files cannot be
|
||||
evicted from the cache.
|
||||
|
||||
#### --vfs-cache-mode off
|
||||
|
@ -225,7 +231,7 @@ It is not allowed for two files in the same directory to differ only by case.
|
|||
Usually file systems on macOS are case-insensitive. It is possible to make macOS
|
||||
file systems case-sensitive but that is not the default
|
||||
|
||||
The "--vfs-case-insensitive" mount flag controls how rclone handles these
|
||||
The !--vfs-case-insensitive! mount flag controls how rclone handles these
|
||||
two cases. If its value is "false", rclone passes file names to the mounted
|
||||
file system as-is. If the flag is "true" (or appears without a value on
|
||||
command line), rclone may perform a "fixup" as explained below.
|
||||
|
@ -246,4 +252,4 @@ The flag controls whether "fixup" is performed to satisfy the target.
|
|||
If the flag is not provided on the command line, then its default value depends
|
||||
on the operating system where rclone runs: "true" on Windows and macOS, "false"
|
||||
otherwise. If the flag is provided without a value, then it is "true".
|
||||
`
|
||||
`, "!", "`")
|
||||
|
|
Loading…
Reference in New Issue
Block a user