Commands

Sync

Guide to using rclone sync - make destinations match source exactly

rclone sync

The powerful but dangerous command - makes the destination exactly match the source. Use with caution!

Featuresynccopymove
Adds new files
Updates changed
Deletes extra at dest⚠️ YES❌ No❌ No
Removes from source❌ No❌ No⚠️ YES
Safe for beginners⚠️

Quick start

# Basic syntax (CAREFUL)
rclone sync SOURCE DESTINATION

# Make remote match local exactly
rclone sync /local/folder remote:backup --dry-run  # Test first!
rclone sync /local/folder remote:backup            # Actually do it

# Make local match remote exactly
rclone sync remote:folder /local/backup --dry-run  # Test first!

Usage

Dry Run (Always Use First!)

# See what would happen without doing it
rclone sync /source remote:dest --dry-run -v

# Check what would be deleted
rclone sync /source remote:dest --dry-run | grep "DELETE"

Backup Before Sync

# Create safety backup first
rclone copy remote:important remote:important-backup-$(date +%Y%m%d)

# Then sync
rclone sync /local remote:important

Limit Damage

# Maximum files to delete (safety net)
rclone sync /source remote:dest --max-delete 10

# Interactive mode (confirm each delete)
rclone sync /source remote:dest --interactive

Performance Optimization

# Fast sync for many files
rclone sync /source remote:dest \
  --transfers 32 \
  --checkers 16 \
  --fast-list \
  --drive-chunk-size 128M

Selective Sync

# Only sync certain files
rclone sync /source remote:dest \
  --include "*.doc" \
  --include "*.pdf" \
  --exclude "*"

# Sync only recent files
rclone sync /source remote:dest --max-age 30d

Verification

# Verify with checksums
rclone sync /source remote:dest --checksum

# Extra verification after sync
rclone check /source remote:dest

Recovery options

Accidentally Deleted Files?

  1. Check cloud trash (Google Drive, OneDrive have trash)
  2. Use versioning if enabled
  3. Restore from snapshots if you made them
  4. Check rclone cache (sometimes files are cached)

Prevention

# Enable versioning on cloud
rclone backend versioning remote:

# Keep snapshots
rclone copy remote:important remote:snapshot-$(date +%Y%m%d)

# Use --backup-dir
rclone sync /source remote:dest \
  --backup-dir remote:old-versions

Remember: With great power comes great responsibility! Sync is powerful but can be destructive if used carelessly.

Further information can be found in the official documentation.

How is this guide?