rclone: notes and tips This note was created on 2024-05-14 This note was last edited on 2024-05-14 rclone is a command-line program to manage files on cloud storage. It is a feature-rich alternative to cloud vendors' web storage interfaces. Over 70 cloud storage products support rclone including S3 object stores, business & consumer file storage services, as well as standard transfer protocols. === Installation on macOS === 1. Download binary for your architecture from https://rclone.org/downloads/ 2. Prepare a local directory for rclone binary: $ mkdir -p /Users/$USER/.local/bin 3. Make sure ".local/bin" is included in your path by checking ".zshrc" configuration file: $ less ~/.local/bin ~~~ ... path+=('/Users/*MYUSERNAME*/.local/bin') export PATH ... ~~~ 4. Unzip the downloaded binary to "~/.local/bin": $ unzip -j Downloads/rclone-*-osx-*.zip "*/rclone" -d $HOME/.local/bin/ 5. Remove binary from macOS quarantine: $ xattr -dr com.apple.quarantine $HOME/.local/bin/rclone 6. Done. === Configuring rclone to backup/store files in encryted format === Note: in this example: - rclone configuration - will be encrypted with custom password. - "crypt remote" will be created locally and encrypted with salt. - file and directory names will be encrypted. 0. Launch interactive configuration session: $ rclone config 1. Set configuration password, as your password and salt will be stored there "lightly obscured": > s > a 2. After setting a configuration password, quit to main menu: > q 3. Create a new "crypt remote": > n 4. Set a name for a new "crypt remote": name> myremotename 5. Choose type of storage to configure (use "crypt or "13" to create it locally): Storage> crypt 6. Choose a path to your local "crypt remote": remote> /home/myusername/vaults/myremotename 7. Enable encryption for file names: filename_encryption> 1 8. Enable encryption for directory names: directory_name_encryption> 1 9. Set a password for your "crypt remote": > y 10. Set a password2/salt for your "crypt remote": > y 11. Don't change advanced settings: > n 12. Confirm the changes to create a new "crypt remote" called "myremotename" in "/home/myusername/vaults/myremotename": > y 13. Done. You can quit interactive configuration session: > q === rclone basics === Enter an interactive configuration session: $ rclone config edit Show path of configuration file in use: $ rclone config file Note: By default, configuration file stored at "$HOME/.config/rclone/rclone.conf". Print (decrypted) config file, or the config for a single remote: $ rclone config show List all the remotes in the config file and defined in environment variables: $ rclone listremotes Check the integrity of an encrypted remote: $ rclone cryptcheck /path/to/files encryptedremote:path Make the path if it doesn't already exist on remote: $ rclone mkdir remote:path Remove the empty directory at path: $ rclone rmdir remote:path Checks the files if the source and destination match. It compares sizes and hashes (MD5 or SHA1) and logs a report of files that don't match: $ rclone check source:path dest:path List the objects in the path. Use one of the following subcommands: - "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. For example: $ rclone lsd remote:path Prints the total size and number of objects in remote:path: $ rclone size remote:path Clean up the remote if possible. Empty the trash or delete old file versions: $ rclone cleanup remote:path Note: Not supported by all remotes. Concatenate a file in remote and send them to stdout: $ rclone cat remote:path/to/file Copy file(s) to remote: $ rclone copy /local/path/file.txt remote:/notes/ Sync directory content to the remote: $ rclone sync --interactive /local/path remote:path Mount encrypted local "crypt remote": $ rclone mount myremotename:/ .local/mnt/ Note: Use ^C to unmount. Dry run: delete file in remote: $ rclone --dry-run delete remote:/notes/test.txt Delete file in remote: $ rclone delete remote:/notes/test.txt