Rclone Bi-Directional Sync (bisync) Quick Guide¶
This guide ensures both your Local Machine and Google Drive are kept in sync using rclone bisync and cron.
Part 1: Initial Sync Setup (Manual)¶
This step establishes the baseline state and must be run once.
-
Run a Test (Dry Run): Confirm the command works and shows the expected copies.
-
Perform Initial Sync: Run the actual command. This creates the state files needed for future runs.
rclone bisync \ --resync \ --progress \ --log-file ~/bisync_initial.log /path/to/local GDRIVE_REMOTE:path/to/remoteNote: Remove the
--resyncflag for all subsequent automated runs. This flag generates initial state files stored in.cache/rclone/bisyncwhich will be used later for comparing and updating.
Part 2: Automation Script¶
Create a script for the cron job, as cron needs the full path for the rclone executable.
-
Create Script:
nano ~/rclone_bisync_auto.sh -
Add Content:
-
Make Executable:
Part 3: Schedule with Cron¶
Use crontab to schedule the script.
-
Open Crontab:
-
Add Entry (Example: Run Every 6 Hours):
Remember: Replace
YOUR_USERNAMEwith your actual username. -
Save and Exit.
Conflict Handling¶
If a file is modified on both sides since the last sync, bisync will:
-
Rename the remote file with a
_conflict_suffix. -
Copy the local file over to the remote.
-
Check the log file (
~/rclone_bisync_runs.log) to review and manually resolve conflicts.