rclone-sync
CleanSync files between local directories and Google Drive using rclone. Provides bidirectional sync, copy, move, and backup operations without needing FUSE mount.
SKILL.md
---
name: rclone-sync
description: "Sync files between local directories and Google Drive using rclone. Provides bidirectional sync, copy, move, and backup operations. Use for transferring files between local and cloud, syncing directories, or managing cloud storage. Keywords: rclone, sync, backup, Google Drive, cloud storage, transfer files, gdrive, copy to drive."
metadata:
polly:
auth:
- env: RCLONE_DRIVE_TOKEN
type: oauth2
integration_id: google-drive
description: Google Drive access for rclone
primaryEnv: RCLONE_DRIVE_TOKEN
---
# Rclone Sync Skill
Manage file transfers between local directories and Google Drive using rclone.
## Authentication Setup
This skill requires Google Drive OAuth. Run:
```bash
manage_auth(action="connect", integration_id="google-drive")
```
Once connected, the `RCLONE_DRIVE_TOKEN` environment variable will be populated with OAuth credentials.
## Quick Start
The `rclone-gdrive.sh` wrapper automatically configures rclone using the OAuth token.
```bash
# Set up alias
alias gdrive='~/skills/user/rclone-sync/scripts/rclone-gdrive.sh'
# List Drive contents
gdrive ls gdrive:
# Copy file to Drive
gdrive copy ./file.txt "gdrive:/folder/"
# Sync local folder TO Drive
gdrive sync ./folder "gdrive:/backup/"
```
## Core Operations
### List Files
```bash
# List files in folder
gdrive ls "gdrive:/My Folder/"
# List directories only
gdrive lsd gdrive:
```
### Copy Files
```bash
# Upload single file
gdrive copy ./report.pdf "gdrive:/Documents/"
# Upload directory (recursive)
gdrive copy ./photos "gdrive:/Photos/" --recursive --progress
# Download file
gdrive copy "gdrive:/Documents/report.pdf" ./
```
### Sync (Important: Read First!)
**Sync makes the destination MATCH the source.** Files in destination not in source will be DELETED.
```bash
# Dry run first
gdrive sync ./folder "gdrive:/backup/" --dry-run
# Then actually sync
gdrive sync ./folder "gdrive:/backup/"
```
### Move and Stream
```bash
# Move file to Drive (removes local)
gdrive move ./file.txt "gdrive:/folder/"
# Upload from stdin
cat file.html | gdrive rcat "gdrive:/polly/file.html"
# View file contents
gdrive cat "gdrive:/document.txt"
```
### Storage Management
```bash
# Check storage usage
gdrive size gdrive:
# Find duplicates
gdrive dedupe "gdrive:/Photos" --dedupe-mode oldest
# Empty trash
gdrive cleanup gdrive:
```
## Filters and Options
```bash
# Exclude specific files
gdrive sync ./folder "gdrive:/backup/" --exclude ".git/**" --exclude "node_modules/**"
# Bandwidth limit
gdrive sync ./folder "gdrive:/backup/" --bwlimit 1M
# Show progress
gdrive copy ./large-file.zip "gdrive:/" --progress
```
## Reference Files
- [references/commands.md](references/commands.md) - Full command reference
Authorhxie
Downloads4
Versions1
Published17h ago
Auth Requirements
RCLONE_DRIVE_TOKENoauth2integration: google-drive
Version History
v1.0.0latest
Initial release with OAuth support
Apr 10, 2026
Clean.zip
SHA-256 (latest)
d403042eacdf12a994f7f1b60317281562b0999425239170f9c34b77c54370ea