cmd

package
v0.0.0-...-5302e5f Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2018 License: MIT Imports: 25 Imported by: 0

Documentation

Overview

Package cmd implemnts the rclone command

It is in a sub package so it's internals can be re-used elsewhere

Index

Constants

This section is empty.

Variables

View Source
var Root = &cobra.Command{
	Use:   "rclone",
	Short: "Sync files and directories to and from local and remote object stores - " + fs.Version,
	Long: `
Rclone is a command line program to sync files and directories to and
from various cloud storage systems and using file transfer services, such as:

  * Amazon Drive
  * Amazon S3
  * Backblaze B2
  * Box
  * Dropbox
  * FTP
  * Google Cloud Storage
  * Google Drive
  * HTTP
  * Hubic
  * Mega
  * Microsoft Azure Blob Storage
  * Microsoft OneDrive
  * OpenDrive
  * Openstack Swift / Rackspace cloud files / Memset Memstore
  * pCloud
  * QingStor
  * SFTP
  * Webdav / Owncloud / Nextcloud
  * Yandex Disk
  * The local filesystem

Features

  * MD5/SHA1 hashes checked at all times for file integrity
  * Timestamps preserved on files
  * Partial syncs supported on a whole file basis
  * Copy mode to just copy new/changed files
  * Sync (one way) mode to make a directory identical
  * Check mode to check for file hash equality
  * Can sync to and from network, eg two different cloud accounts

See the home page for installation, usage, documentation, changelog
and configuration walkthroughs.

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

Root is the main rclone command

Functions

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 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 a 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() chan struct{}

StartStats prints the stats every statsInterval

It returns a channel which should be closed to stop the stats.

Types

This section is empty.

Directories

Path Synopsis
Package all imports all the commands
Package all imports all the commands
ls
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.
httplib
Package httplib provides common functionality for http servers
Package httplib provides common functionality for http servers
restic
Package restic serves a remote suitable for use with restic
Package restic serves a remote suitable for use with restic

Jump to

Keyboard shortcuts

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