← Back to context

Comment by horsellama

1 day ago

fwiw, on mac/ios you can put your obsidian vault inside icloud directory and have a “free” cross-device sync feature.

Hell, you don't even need obsidian. Just create a bash function

    notes()
    {
    if [ ! -z "$1" ]; then
        mkdir -m 00750 -p /Users/User/iCloud/Documents/notes
        Now=$(date '+%B %d %Y %H:%M')
        echo -en "\n$Now\t$@\n" >> /Users/User/iCloud/Documents/notes/notes.txt
    else
        echo "${Now}"
        cat /Users/User/iCloud/Documents/notes/notes.txt 2>/dev/null
        fi
    }

  • While we're sharing simple note taking functions, here's mine that I used for a few years. :)

        function nod { mg +-1 "/home/user/notes/$(date "+%Y-%m-%d").txt"; }
    

    * 'nod' stands for "notes of (the) day" and was quick to type.

    * 'mg' is micro emacs, my first shell-based editor thanks to OpenBSD. The '+-1' syntax means "open at end of file" so I could easily append.

Works if you are in the Apple ecosystem entirely. I have read there are difficulties if you want to sync to a non Apple device under this approach

  • This is one of the reasons I use a git repo along with iCloud. Anyway, using iCloud across 4+ Apple devices has not been a problem in general.

I had the bright idea of symlinking $HOME/.local to an iCloud directory once. About a week later it got completely deleted. No way to restore, or any indication of what happened. Luckily I had a backup with another provider, but I will never trust iCloud again for anything that’s not on the golden path (e.g. photos)