LinuxCommandLibrary

rclone

Synchronize files to and from cloud storage

TLDR

Launch an interactive menu to setup rclone

$ rclone config
copy

List contents of a directory on an rclone remote
$ rclone lsf [remote_name]:[path/to/directory]
copy

Copy a file or directory from the local machine to the remote destination
$ rclone copy [path/to/source_file_or_directory] [remote_name]:[path/to/directory]
copy

Copy files changed within the past 24 hours to a remote from the local machine, asking the user to confirm each file
$ rclone copy [[-i|--interactive]] --max-age 24h [remote_name]:[path/to/directory] [path/to/local_directory]
copy

Mirror a specific file or directory (Note: Unlike copy, sync removes files from the remote if it does not exist locally)
$ rclone sync [path/to/file_or_directory] [remote_name]:[path/to/directory]
copy

Delete a remote file or directory (Note: --dry-run means test, remove it from the command to actually delete)
$ rclone [[-n|--dry-run]] delete [remote_name]:[path/to/file_or_directory]
copy

Mount rclone remote (experimental)
$ rclone mount [remote_name]:[path/to/directory] [path/to/mount_point]
copy

Unmount rclone remote if fails (experimental)
$ fusermount [[-u|--update]] [path/to/mount_point]
copy

SYNOPSIS

rclone [global flags] command [arguments] [command flags]

PARAMETERS

--config
    Specifies the path to the `rclone` configuration file.

--dry-run
    Performs a trial run without making any changes, showing what would happen.

-v, --verbose
    Increases verbosity to info level logging.

-vv
    Increases verbosity to debug level logging.

--progress
    Shows progress during transfer operations.

--checksum
    Checks the checksum of files after transfer for verification.

--bwlimit
    Limits bandwidth usage during transfers (e.g., 1M, 1G).

--include
    Includes files matching the specified filter pattern.

--exclude
    Excludes files matching the specified filter pattern.

--filter-from
    Reads filter patterns from a specified file.

--transfers
    Sets the number of file transfers to run in parallel.

--checkers
    Sets the number of checksum checkers to run in parallel.

--ignore-existing
    Skips files that already exist at the destination.

--immutable
    Prevents modification of files at the destination, useful for append-only backups.

--log-file
    Writes log messages to the specified file.

--timeout
    Sets the IO idle timeout.

--retries
    Number of times to retry a failed operation.

DESCRIPTION

rclone is a powerful command-line program to manage files on cloud storage. It is often described as "rsync for cloud storage" because of its robust synchronization capabilities, but it offers much more. rclone supports over 50 cloud storage providers, including popular services like Amazon S3, Google Drive, Microsoft OneDrive, Dropbox, and many others, as well as local file systems and SSH/SFTP.

Its core functionalities include copying, syncing, moving, deleting, and listing files and directories. rclone can perform one-way and two-way synchronization, ensuring that data is kept consistent across different locations. It features client-side encryption, allowing users to encrypt files before uploading them to the cloud, enhancing privacy and security.

A significant feature of rclone is its ability to mount cloud storage as a local file system using FUSE, making cloud data accessible to any application as if it were on a local disk. This makes it incredibly versatile for tasks such as backing up data, migrating files between cloud providers, streaming media directly from cloud storage, or even serving files via HTTP/WebDAV. Its reliability, speed, and comprehensive feature set make rclone an indispensable tool for managing vast amounts of data across diverse cloud environments.

CAVEATS

  • Data Loss Risk: The `sync` command is powerful and can cause irreversible data loss if used incorrectly, as it makes the destination an exact copy of the source, potentially deleting files on the destination. Always use `--dry-run` first.
  • Performance with Small Files: Transferring a very large number of small files can be slower than expected due to overheads from API calls.
  • API Rate Limits: Cloud providers often impose API rate limits. While rclone attempts to handle these, excessive operations can still lead to throttling or temporary bans.
  • Complexity: Due to its extensive feature set and numerous options, rclone can have a steep learning curve for new users.

<B>SUPPORTED CLOUD PROVIDERS</B>

rclone boasts support for over 50 cloud storage providers, including but not limited to: Amazon S3, Google Drive, Google Cloud Storage, Microsoft OneDrive, Dropbox, Backblaze B2, SFTP, FTP, WebDAV, Azure Blob Storage, Box, pCloud, Yandex Disk, and local file systems. This extensive compatibility makes it a universal tool for cloud data management.

<B>CLIENT-SIDE ENCRYPTION</B>

rclone provides robust client-side encryption, allowing users to encrypt file names and contents before they leave the local machine. This ensures that data stored on cloud providers remains private and secure, as the cloud provider only receives encrypted data, unable to read or access the original content.

<B>FUSE MOUNT CAPABILITIES</B>

One of rclone's standout features is its ability to mount remote cloud storage as a local filesystem using FUSE (Filesystem in Userspace). This allows any application on the system to interact with cloud files and folders as if they were stored locally, enabling seamless integration with other tools, streaming media, or editing files directly from the cloud.

<B>CONFIGURATION AND REMOTES</B>

rclone manages connections to cloud storage providers through "remotes," which are configured interactively or via a configuration file (`~/.config/rclone/rclone.conf`). Each remote stores the necessary credentials and settings for a specific cloud service, simplifying subsequent operations by referencing the remote's name (e.g., `mygoogledrive:`).

HISTORY

rclone was created by Nick Craig-Wood and first released in 2014. Written in Go, it quickly gained popularity due to its cross-platform compatibility, robust feature set, and support for a growing number of cloud storage providers. It originated from the need for a reliable `rsync`-like tool for cloud storage, evolving into a comprehensive file management utility. The project is open-source and actively developed, with a strong community contributing to its continuous improvement and expansion of supported services.

SEE ALSO

rsync(1), scp(1), sftp(1), curl(1), mount(8), tar(1)

Copied to clipboard