Commands
Bisync
Guide for rclone's bisync command (bidirectional synchronization)
rclone bisync
The two-way sync command is used to keep two locations synchronized with changes flowing both ways.
| Feature | bisync | sync | copy |
|---|---|---|---|
| Direction | Both ways | One way | One way |
| Deletes at destination | ✅ | ✅ | ❌ |
| Handles conflicts | ✅ (newer wins by default) | N/A | N/A |
| Requires initial setup | ✅ (--resync) | ❌ | ❌ |
| Complexity | High | Medium | Low |
Quick start
Prepare Locations
# Make sure both locations exist
mkdir -p /local/sync-folder
rclone mkdir remote:sync-folderInitial Resync
# Establish baseline (choose direction!)
# This makes remote match local:
rclone bisync /local/sync-folder remote:sync-folder --resync
# Or make local match remote:
rclone bisync remote:sync-folder /local/sync-folder --resync --forceTest Regular Sync
# Test bidirectional sync
echo "test" > /local/sync-folder/test.txt
rclone bisync /local/sync-folder remote:sync-folder
# File appears on remote
# Make change on remote and sync back
rclone bisync /local/sync-folder remote:sync-folder
# Changes flow both ways!Safety features
Access Check Files
# Create check files for safety
touch /local/folder/RCLONE_TEST
rclone touch remote:folder/RCLONE_TEST
# Sync with access check
rclone bisync /local/folder remote:folder \
--check-access \
--check-filename RCLONE_TESTIf check files disappear, sync stops (preventing accidental mass deletion).
Limit Deletions
# Stop if too many deletions
rclone bisync /local remote:path \
--max-delete 10
# Percentage-based limit
rclone bisync /local remote:path \
--max-delete 50%Conflict Resolution
# Default: newer file wins
rclone bisync /local remote:path
# Keep both versions of conflicts
rclone bisync /local remote:path \
--conflict-resolve newer \
--conflict-loser delete
# Options: newer, older, larger, smaller, path1, path2Common use cases
Keep Laptop and Desktop in Sync
#!/bin/bash
# Sync work folders between computers
# On laptop
rclone bisync ~/Documents remote:Documents \
--check-access \
--max-delete 10 \
--filters-file sync-filters.txt
# Same command on desktop
# Changes flow both ways!Sync Phone Photos
# Bi-directional photo sync
rclone bisync /phone/DCIM remote:Photos \
--check-access \
--include "*.{jpg,mp4,png}" \
--max-delete 5%Collaborative Folders
# Team shared folder
rclone bisync /local/team-share remote:team \
--check-access \
--conflict-resolve newer \
--backup-dir remote:conflictsAdvanced
Filters and Exclusions
# Exclude certain files from sync
rclone bisync /local remote:path \
--exclude ".git/**" \
--exclude "*.tmp" \
--exclude ".DS_Store" \
--exclude "Thumbs.db"
# Using filter file
cat > bisync-filters.txt << EOF
- .git/**
- node_modules/**
- *.tmp
- .*.swp
EOF
rclone bisync /local remote:path --filters-file bisync-filters.txtBackup Conflicts
# Save conflicting versions
rclone bisync /local remote:path \
--conflict-resolve newer \
--conflict-loser rename \
--conflict-suffix .conflictManual Conflict Resolution
# 1. Dry run to see conflicts
rclone bisync /local remote:path --dry-run
# 2. Manually review and fix conflicts
# 3. Force resync after manual resolution
rclone bisync /local remote:path --resyncScheduled Sync
# Cron job for regular sync (Linux/Mac)
*/30 * * * * rclone bisync /local remote:path --check-access >> ~/bisync.log 2>&1
# Windows Task Scheduler
rclone bisync C:\Local remote:path --check-accessRecovering Files
# 1. Stop all sync operations
# 2. Check both locations
rclone ls /local/path > local-files.txt
rclone ls remote:path > remote-files.txt
# 3. Restore from backup if needed
rclone copy remote:backup /local/restored
# 4. Reset bisync state
rm -rf ~/.cache/rclone/bisync/
rclone bisync /local remote:path --resyncTroubleshooting
"Need --resync" Error
# Sync state is broken, needs reset
rclone bisync /local remote:path --resync
# Choose direction carefully!
# --resync makes destination match sourceToo Many Deletions
# Bisync stopped due to safety limit
# Check what's being deleted:
rclone check /local remote:path
# If deletions are intentional:
rclone bisync /local remote:path --force
# Or increase limit:
rclone bisync /local remote:path --max-delete 100Sync Loop
# Files keep changing every sync
# Usually due to timestamp issues
# Fix with:
rclone bisync /local remote:path \
--ignore-times \
--check-first⚠️ Careful
Bisync is powerful but complex!
- Used in production, but in active development
- Requires careful setup
- Can cause data loss if misconfigured (use
--dry-runbefore running, use--max-deleteto limit deletions) - Not suitable for syncing multiple devices at once
Check out the full documentation if you need more information.
How is this guide?