rclone is a powerful command-line tool that lets you sync files between your system and cloud services like Google Drive, Dropbox, S3, and more.
๐ฆ Install Rclone
Ubuntu / Debian
sudo apt update
sudo apt install rclone
Fedora
sudo dnf install rclone
Arch Linux
sudo pacman -S rclone
โ๏ธ Initial Setup
Run the config wizard:
rclone config
- Choose n (new remote)
- Name it (e.g.,
mydrive) - Select storage (Google Drive, S3, etc.)
- Follow authentication steps
๐ Basic Commands
List remotes
rclone listremotes
List files in remote
rclone ls mydrive:
Copy files (one-way)
rclone copy /home/user/files mydrive:backup
Sync (mirror source โ destination)
rclone sync /home/user/files mydrive:backup
โ ๏ธ sync deletes extra files in destination!
๐ Common Examples
Download from cloud
rclone copy mydrive:backup /home/user/files
Sync two folders
rclone sync /local/folder remote:folder
Show progress
rclone copy /data remote:backup -P
๐ Mount Cloud Storage
rclone mount mydrive: /mnt/mydrive --daemon
โ Access cloud like a local drive
โก Useful Flags
-Pโ Show progress--dry-runโ Preview changes--delete-excludedโ Clean destination--bwlimit 1Mโ Limit bandwidth
โฑ๏ธ Automate with Cron
Schedule backups:
crontab -e
Example (daily backup at 2 AM):
0 2 * * * rclone sync /home/user/data mydrive:backup
โ ๏ธ Common Issues
Authentication fails
- Re-run:
rclone config
Slow transfers
- Use:
--transfers=8 --checkers=8
Permission errors
- Check folder ownership and access
๐ง When to Use Rclone
- Cloud backups
- Server-to-cloud sync
- Migrating data between providers
- Automated offsite storage
๐ก Pro Tip
Start with a dry run before syncing:
rclone sync /data remote:backup --dry-run
โ Prevents accidental data loss