cmd

package
v1.67.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 23, 2024 License: MIT Imports: 39 Imported by: 5

Documentation

Overview

Package cmd implements the rclone command

It is in a sub package so it's internals can be reused elsewhere

Index

Constants

This section is empty.

Variables

View Source
var GeneratingDocs = false

GeneratingDocs is set by rclone gendocs to alter the format of the output suitable for the documentation.

View Source
var Root = &cobra.Command{
	Use:   "rclone",
	Short: "Show help for rclone commands, flags and backends.",
	Long: `
Rclone syncs files to and from cloud storage providers as well as
mounting them, listing them in lots of different ways.

See the home page (https://rclone.org/) for installation, usage,
documentation, changelog and configuration walkthroughs.

`,
	PersistentPostRun: func(cmd *cobra.Command, args []string) {
		fs.Debugf("rclone", "Version %q finishing with parameters %q", fs.Version, os.Args)
		atexit.Run()
	},
	ValidArgsFunction: validArgs,
	DisableAutoGenTag: true,
}

Root is the main rclone command

Functions

func AddBackendFlags

func AddBackendFlags()

AddBackendFlags creates flags for all the backend options

func CheckArgs

func CheckArgs(MinArgs, MaxArgs int, cmd *cobra.Command, args []string)

CheckArgs checks there are enough arguments and prints a message if not

func Main

func Main()

Main runs rclone interpreting flags and commands out of os.Args

func NewFsDir

func NewFsDir(args []string) fs.Fs

NewFsDir creates a new Fs from the arguments

The argument must point a directory

func NewFsDstFile

func NewFsDstFile(args []string) (fdst fs.Fs, dstFileName string)

NewFsDstFile creates a new dst fs with a destination file name from the arguments

func NewFsFile

func NewFsFile(remote string) (fs.Fs, string)

NewFsFile creates an Fs from a name but may point to a file.

It returns a string with the file name if points to a file otherwise "".

func NewFsSrc

func NewFsSrc(args []string) fs.Fs

NewFsSrc creates a new src fs from the arguments.

The source can be a file or a directory - if a file then it will limit the Fs to a single file.

func NewFsSrcDst

func NewFsSrcDst(args []string) (fs.Fs, fs.Fs)

NewFsSrcDst creates a new src and dst fs from the arguments

func NewFsSrcDstFiles

func NewFsSrcDstFiles(args []string) (fsrc fs.Fs, srcFileName string, fdst fs.Fs, dstFileName string)

NewFsSrcDstFiles creates a new src and dst fs from the arguments If src is a file then srcFileName and dstFileName will be non-empty

func NewFsSrcFileDst

func NewFsSrcFileDst(args []string) (fsrc fs.Fs, srcFileName string, fdst fs.Fs)

NewFsSrcFileDst creates a new src and dst fs from the arguments

The source may be a file, in which case the source Fs and file name is returned

func Run

func Run(Retry bool, showStats bool, cmd *cobra.Command, f func() error)

Run the function with stats and retries if required

func ShowStats

func ShowStats() bool

ShowStats returns true if the user added a `--stats` flag to the command line.

This is called by Run to override the default value of the showStats passed in.

func ShowVersion

func ShowVersion()

ShowVersion prints the version to stdout

func SigInfoHandler

func SigInfoHandler()

SigInfoHandler creates SigInfo handler

func StartStats

func StartStats() func()

StartStats prints the stats every statsInterval

It returns a func which should be called to stop the stats.

Types

This section is empty.

Directories

Path Synopsis
Package about provides the about command.
Package about provides the about command.
Package all imports all the commands
Package all imports all the commands
Package authorize provides the authorize command.
Package authorize provides the authorize command.
Package backend provides the backend command.
Package backend provides the backend command.
Package bisync implements bisync Copyright (c) 2017-2020 Chris Nelson
Package bisync implements bisync Copyright (c) 2017-2020 Chris Nelson
bilib
Package bilib provides common stuff for bisync and bisync_test
Package bilib provides common stuff for bisync and bisync_test
Package cachestats provides the cachestats command.
Package cachestats provides the cachestats command.
Package cat provides the cat command.
Package cat provides the cat command.
Package check provides the check command.
Package check provides the check command.
Package checksum provides the checksum command.
Package checksum provides the checksum command.
Package cleanup provides the cleanup command.
Package cleanup provides the cleanup command.
Package cmount implements a FUSE mounting system for rclone remotes.
Package cmount implements a FUSE mounting system for rclone remotes.
Package config provides the config command.
Package config provides the config command.
Package copy provides the copy command.
Package copy provides the copy command.
Package copyto provides the copyto command.
Package copyto provides the copyto command.
Package copyurl provides the copyurl command.
Package copyurl provides the copyurl command.
Package cryptcheck provides the cryptcheck command.
Package cryptcheck provides the cryptcheck command.
Package cryptdecode provides the cryptdecode command.
Package cryptdecode provides the cryptdecode command.
Package dedupe provides the dedupe command.
Package dedupe provides the dedupe command.
Package delete provides the delete command.
Package delete provides the delete command.
Package deletefile provides the deletefile command.
Package deletefile provides the deletefile command.
Package genautocomplete provides the genautocomplete command.
Package genautocomplete provides the genautocomplete command.
Package gendocs provides the gendocs command.
Package gendocs provides the gendocs command.
Package gitannex provides the "gitannex" command, which enables [git-annex] to communicate with rclone by implementing the [external special remote protocol].
Package gitannex provides the "gitannex" command, which enables [git-annex] to communicate with rclone by implementing the [external special remote protocol].
Package hashsum provides the hashsum command.
Package hashsum provides the hashsum command.
Package link provides the link command.
Package link provides the link command.
Package ls provides the ls command.
Package ls provides the ls command.
ls
Package ls provides the ls command.
Package ls provides the ls command.
lshelp
Package lshelp provides common help for list commands.
Package lshelp provides common help for list commands.
Package lsd provides the lsd command.
Package lsd provides the lsd command.
Package lsf provides the lsf command.
Package lsf provides the lsf command.
Package lsjson provides the lsjson command.
Package lsjson provides the lsjson command.
Package lsl provides the lsl command.
Package lsl provides the lsl command.
Package md5sum provides the md5sum command.
Package md5sum provides the md5sum command.
Package mkdir provides the mkdir command.
Package mkdir provides the mkdir command.
Package mount implements a FUSE mounting system for rclone remotes.
Package mount implements a FUSE mounting system for rclone remotes.
Package mount2 implements a FUSE mounting system for rclone remotes.
Package mount2 implements a FUSE mounting system for rclone remotes.
Package mountlib provides the mount command.
Package mountlib provides the mount command.
Package move provides the move command.
Package move provides the move command.
Package moveto provides the moveto command.
Package moveto provides the moveto command.
Package ncdu implements a text based user interface for exploring a remote
Package ncdu implements a text based user interface for exploring a remote
scan
Package scan does concurrent scanning of an Fs building up a directory tree.
Package scan does concurrent scanning of an Fs building up a directory tree.
Package nfsmount implements mounting functionality using serve nfs command
Package nfsmount implements mounting functionality using serve nfs command
Package obscure provides the obscure command.
Package obscure provides the obscure command.
Package purge provides the purge command.
Package purge provides the purge command.
Package rc provides the rc command.
Package rc provides the rc command.
Package rcat provides the rcat command.
Package rcat provides the rcat command.
Package rcd provides the rcd command.
Package rcd provides the rcd command.
Package reveal provides the reveal command.
Package reveal provides the reveal command.
Package rmdir provides the rmdir command.
Package rmdir provides the rmdir command.
Package rmdir provides the rmdir command.
Package rmdir provides the rmdir command.
Package selfupdate provides the selfupdate command.
Package selfupdate provides the selfupdate command.
Package serve provides the serve command.
Package serve provides the serve command.
dlna
Package dlna provides DLNA server.
Package dlna provides DLNA server.
dlna/data
Package data provides utilities for DLNA server.
Package data provides utilities for DLNA server.
dlna/dlnaflags
Package dlnaflags provides utility functionality to DLNA.
Package dlnaflags provides utility functionality to DLNA.
dlna/upnpav
Package upnpav provides utilities for DLNA server.
Package upnpav provides utilities for DLNA server.
docker
Package docker serves a remote suitable for use with docker volume api
Package docker serves a remote suitable for use with docker volume api
ftp
Package ftp implements an FTP server for rclone
Package ftp implements an FTP server for rclone
http
Package http provides common functionality for http servers
Package http provides common functionality for http servers
nfs
Package nfs implements a server to serve a VFS remote over NFSv3 protocol
Package nfs implements a server to serve a VFS remote over NFSv3 protocol
proxy
Package proxy implements a programmable proxy for rclone serve
Package proxy implements a programmable proxy for rclone serve
proxy/proxyflags
Package proxyflags implements command line flags to set up a proxy
Package proxyflags implements command line flags to set up a proxy
restic
Package restic serves a remote suitable for use with restic
Package restic serves a remote suitable for use with restic
s3
Package s3 implements an s3 server for rclone
Package s3 implements an s3 server for rclone
servetest
Package servetest provides infrastructure for running loopback tests of "rclone serve backend:" against the backend integration tests.
Package servetest provides infrastructure for running loopback tests of "rclone serve backend:" against the backend integration tests.
sftp
Package sftp implements an SFTP server to serve an rclone VFS
Package sftp implements an SFTP server to serve an rclone VFS
webdav
Package webdav implements a WebDAV server backed by rclone VFS
Package webdav implements a WebDAV server backed by rclone VFS
Package settier provides the settier command.
Package settier provides the settier command.
Package sha1sum provides the sha1sum command.
Package sha1sum provides the sha1sum command.
Package size provides the size command.
Package size provides the size command.
Package sync provides the sync command.
Package sync provides the sync command.
Package test provides the test command.
Package test provides the test command.
changenotify
Package changenotify tests rclone's changenotify support
Package changenotify tests rclone's changenotify support
histogram
Package histogram provides the histogram test command.
Package histogram provides the histogram test command.
info
Package info provides the info test command.
Package info provides the info test command.
info/internal
Package internal provides internal implementation for the info test command.
Package internal provides internal implementation for the info test command.
info/internal/build_csv
Package main provides utilities for the info test command.
Package main provides utilities for the info test command.
makefiles
Package makefiles builds a directory structure with the required number of files in of the required size.
Package makefiles builds a directory structure with the required number of files in of the required size.
memory
Package memory provides the memory test command.
Package memory provides the memory test command.
Package touch provides the touch command.
Package touch provides the touch command.
Package tree provides the tree command.
Package tree provides the tree command.
Package version provides the version command.
Package version provides the version command.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL