Hi Tobias,

On Fri, 11 Sep 2015 06:59:31 -0700,
Tobias Frischholz <tob...@friolz.com> wrote:
> 
> Hey there!
> 
> I was wondering what is your favorite way of syncing your org files and 
> everything.
> I’ve checked out unison, but I want more of an automated system that 
> synchronizes my two clients via an SSH server.

> […]

I finally settled on the following (although syncthing looks
promising):

1. git for my 2 org dirs (for home & work)

2. git-annex to manage attachments (I have a local patch to
automatically get annex files from a repo when opening, but haven’t
submitted it yet)

3. git-auto-commit-mode with the following setup:

  ;; auto-commit to git if the file is in one of my notes repos
  (defun egh:maybe-git-auto-commit-mode ()
    (let* ((bfn (buffer-file-name))
           (root (and bfn (vc-git-root (buffer-file-name))))
           (full-root (and root (expand-file-name root))))
      (if (or (string-equal full-root "/home/egh/c/notes/h/")
              (string-equal full-root "/home/egh/c/notes/w/"))
          (git-auto-commit-mode +1))))

  (add-hook 'org-mode-hook #'egh:maybe-git-auto-commit-mode)
  (setq-default gac-automatically-push-p t)

4. A simple script called morning to sync it up:
Hope that helps!

  #!/bin/sh
  cd ~/c/notes/h
  git pull origin master
  git annex copy --fast --to=cloud
  git annex sync

best, Erik
--
Sent from my free software system <http://fsf.org/>.

Reply via email to