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!
| Feature | sync | copy | move |
|---|---|---|---|
| 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:importantLimit 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 --interactivePerformance Optimization
# Fast sync for many files
rclone sync /source remote:dest \
--transfers 32 \
--checkers 16 \
--fast-list \
--drive-chunk-size 128MSelective 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 30dVerification
# Verify with checksums
rclone sync /source remote:dest --checksum
# Extra verification after sync
rclone check /source remote:destRecovery options
Accidentally Deleted Files?
- Check cloud trash (Google Drive, OneDrive have trash)
- Use versioning if enabled
- Restore from snapshots if you made them
- 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-versionsRemember: 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?