Rclone
Rclone is a command-line program for managing files across local and cloud storage. Its native Files.com backend connects through the Files.com API.
Rclone has powerful cloud equivalents to the unix commands rsync, cp, mv, mount, ls, ncdu, tree, rm, and cat. Rclone's familiar syntax includes shell pipeline support, and --dry-run protection. It is used at the command line, in scripts, or via its API.
Support for Files.com is available in rclone version 1.68.0 and higher.
Getting Started with Rclone
- Download and install rclone
- Configure rclone with credentials and connection information for your Files.com site(s)
- Run rclone commands
Configuring Rclone for Files.com
Use the rclone config command to configure rclone with a new remote connection to your Files.com site.
The configuration wizard will walk you through the setup and will prompt you for your site information (subdomain or custom domain hostname, without https://) and your authentication information. You can authenticate using a username and password, or using an API key.
Using Rclone with Files.com
Rclone commands can be used with Files.com to upload, download, sync, list, copy, move, generate share links, and delete items.
Listing
You can list the contents of your Files.com site in various ways, using the following commands:
rclone ls myfilescomsite:path/to/files/dir/
rclone lsd myfilescomsite:path/to/files/dir/
rclone lsf myfilescomsite:path/to/files/dir/
rclone lsjson myfilescomsite:path/to/files/dir/
rclone lsl myfilescomsite:path/to/files/dir/
rclone tree myfilescomsite:path/to/files/dir/
You can also view the storage usage of a folder using the interactive ncdu command:
rclone ncdu myfilescomsite:path/to/files/dir/
Uploading
You can upload items into your Files.com site from your local computer or from another cloud storage provider using the copy command:
rclone copy ~/path/to/local/dir/ myfilescomsite:path/to/dest/dir/
rclone copy myawsbucket:/path/to/source/dir/ myfilescomsite:path/to/dest/dir/
Downloading
You can download items from your Files.com site to your local computer or to another cloud storage provider using the copy command:
rclone copy myfilescomsite:path/to/source/dir/ ~/path/to/local/dir/
rclone copy myfilescomsite:path/to/source/dir/ myazurebucket:/path/to/dest/dir/
Synchronizing
The sync command makes the destination match the source, including deleting destination files that are absent from the source. Add --dry-run to preview the changes before running the sync:
rclone sync ~/path/to/local/dir/ myfilescomsite:path/to/dest/dir/ -P --dry-run
rclone sync myawsbucket:/path/to/source/dir/ myfilescomsite:path/to/dest/dir/ -P --dry-run
Remove --dry-run after reviewing the proposed changes to perform the sync.
Copy and Move
Rclone can also copy and move items within Files.com. This avoids any uploading or downloading of content as the copy and move actions occur within your Files.com site.
rclone copyto myfilescomsite:path/to/file.txt myfilescomsite:path/to/dest/renamed.txt
rclone moveto myfilescomsite:path/to/file.txt myfilescomsite:path/to/dest/renamed.txt
rclone copyto myfilescomsite:path/to/source/dir/ myfilescomsite:path/to/dest/renameddir/
rclone moveto myfilescomsite:path/to/source/dir/ myfilescomsite:path/to/dest/renameddir/
Share Links
Rclone can ask Files.com to generate a share link to a file or folder. These links can be used by recipients who do not have access credentials on your Files.com site to access the linked item.
rclone link --expire 10d myfilescomsite:path/to/file.txt
rclone link --expire 30d myfilescomsite:path/to/folder
Deleting
You can delete items in your Files.com site in various ways, using the following commands:
rclone delete myfilescomsite:path/to/file.txt --interactive
rclone rmdir myfilescomsite:path/to/emptyfolder --interactive
rclone purge myfilescomsite:path/to/fullfolder --interactive
Check first before performing any delete or purge action. Use the --dry-run flag to see what will be deleted, or use the --interactive flag to prompt you before each delete.