DEV Community

Cover image for Obsidian Sync - with Powershell
Abhik Ghosh
Abhik Ghosh

Posted on

Obsidian Sync - with Powershell

I was an Evernote user until not anymore. If you ever used Evernote, you know the ease this tool brings to your life. You throw anything at it and Evernote keeps everything synced up to the cloud and made them available immediately on other devices. If you switch device and wish(for whatever reason) to view what you just uploaded in another device - it is there. I used Evernote for my work, personal knowledge, journal and also as a file cabinet. Everything was good and I had only one complaint that they just let you sync only two devices on the free plan - Evernote why not just three, I wanted evernote on my Ipad too?

Until recently, this was my tool for note taking. But then I saw many productivity experts talking about the issues with recent Evernote builds and the security concerns. I heard people saying what if Evernote shuts them down tomorrow and does not let you take back up of your notes. ๐Ÿ˜Ÿ This was a trigger point, I started noticing many other problems along with whatever was said about Evernote at the time. I started feeling the tool a little slow to open, the sync suddenly started taking lot of time. May be everything I was seeing because I was convinced that someday, I'm going to loose my notes if Evernotes gets shutdown ๐Ÿ™‚. More than the security concern, I was worried about losing those years worth of notes.

I found Obsidian online. Oh, all my problems solved and this is free. or was it? The sync is sold as a service and I was not ready to take that monthly recurring cost just yet. I wanted to try things myself. Below are what I use on a day to day basis. I was trying to solve the syncing issue between these devices:

  1. A Lenovo WIndows 11 Laptop
  2. An Android 11 phone - make and iteration doesn't matter
  3. An Ipad 8th Gen

There are lots of discussions around the similar topic - https://forum.obsidian.md/t/mobile-app-for-iphone-sync-with-dropbox/18676/7
But I was mostly sure that the Android phone cannot sync from icloud drive and Ipad cannot sync from dropbox. But my computer can sync to both - Thanks ๐Ÿ’–Windows.

I tried Linux/ Win utilities like rsync(wsl2), robocopy but finally settled with writing couple of powershell scripts to have a better control on the files.

How does it work

Step1: I keep my Obsidian Vault in Dropbox Sync folder.
Step2: I use a free app called DropSync on my Andoird. This allows me to sync my Andoird's local drive vault and Dropbox
Step3: I wrote a powershell script to push my vault to icloud sync folder. The script only copies files which have increased in size(Not best way - but worked for me, specially at times the last modified dates are little less reliable)
Step4: I open the icloud vault on my Ipad. If I modify anything on the Ipad, the changes are then synced to the icloud drive and essentially available on my computer before I next time use it.
Step5: I have a powershell script to sync anything new from the icloud drive to my computer vault(which is sitting in the Dropbox sync folder).
Step6: Just as an extra step of caution, I take backup of my vault on my computer harddrive and save the file in Google drive once everyday.

This is totally overkill for the purpose, you may say. But one less thing to worry about, right? You can focus more on your notes.
Obsidian Sync

Here is the repo for your reference - https://github.com/abhgho/obsidian-powershell-automation


Photo by Damian Zaleski on Unsplash

Top comments (0)