October 12, 2024

iCloud drive sync with a Linux, Ubuntu, device

Updated 2024-10-12

With my project to keep a MacBook Air 2011(MBA) alive, Ubuntu installed, i searched for a solution where my iCoud drive(iCD) was 
continuous synced with my MBA. This must work both ways so even a file change made on MBA should be replicated to iCD.

There is MultCloud, are there others ?, but the free version is just 5 Gb data traffic per month. There is also a work in progress (availabel as Beta) with rclone and iCD. 

So while waiting for a free working version I solved my sync between iCD and MBA with Syncthing(ST). ST doesn't sync with iCloud so the work around here was to use my MacMini, Mac OS, as the "Middle man". It's always on and synced with iCD.

SyncThing
Mac OS install
Get the latest version and install in the standard app folder
To start app att login "System Settings > General > Login Items" Click the add button, +, and select the "syncthing.app".

Ubuntu install
In the terminal 

sudo apt update 
sudo apt install syncthing 

Autostart of the ST app is made with the below commands where you should change "mats_a" to your user.

mats_a@MacB:~$ sudo systemctl enable syncthing@mats_a.service
Created symlink /etc/systemd/system/multi-user.target.wants/syncthing@mats_a.service → /usr/lib/systemd/system/syncthing@.service.
mats_a@MacB:~$ sudo systemctl start syncthing@mats_a.service
mats_a@MacB:~$ sudo systemctl status syncthing@mats_a.service
● syncthing@mats_a.service - Syncthing - Open Source Continuous File Synchronization for mats_a
     Loaded: loaded (/usr/lib/systemd/system/syncthing@.service; enabled; preset: enabled)
     Active: active (running) since Sat 2024-09-14 20:03:00 CEST; 89ms ago
       Docs: man:syncthing(1)
   Main PID: 4648 (syncthing)
      Tasks: 18 (limit: 4510)
     Memory: 9.1M (peak: 9.4M)
        CPU: 75ms
     CGroup: /system.slice/system-syncthing.slice/syncthing@mats_a.service
             ├─4648 /usr/bin/syncthing serve --no-browser --no-restart --logflags=0
             └─4656 /usr/bin/syncthing serve --no-browser --no-restart --logflags=0

Sep 14 20:03:00 MacB systemd[1]: syncthing@mats_a.service: Scheduled restart job, restart counter is >
Sep 14 20:03:00 MacB systemd[1]: Started syncthing@mats_a.service - Syncthing - Open Source Continuou>
Sep 14 20:03:00 MacB syncthing[4648]: [start] INFO: syncthing v1.27.2-ds4 "Gold Grasshopper" (go1.22.>
Sep 14 20:03:00 MacB syncthing[4648]: [TP7XP] INFO: My ID: TP7XPH5-ZAH5J25-OC5KGSB-7B45XKC-S2WIP33-7E>

Setup
In both cases you will reach the ST interface at http://localhost:8384/

Here is getting started where I, on Mac OS, share the "Documents" folder to the Ubuntu device.
On the Ubuntu device set up a path to a folder where the "Documents" on the Mac OS shall sync.

Then test that the sync works both ways.


No comments:

Post a Comment

Feel free to leave a comment ! ... but due to a lot of spam comments I have to moderate them. Will reply ASAP !