LoginSignup
14
11

More than 5 years have passed since last update.

Mac 版 Kobito のローカル記事を Dropbox でバックアップする

Last updated at Posted at 2015-08-15

先日、4 年間使った Macbook の電源が入らなくなり買い替えました。Time Machine でのバックアップは 2 ヶ月前のものだけ。だいたいのデータは Dropbox, iCould, Google, GitHub, Evernote など何かしらのクラウドサービスに入っていたのですが、Kobito のローカルのメモだけがバックアップされていませんでした。今日は Kobito のバックアップの設定をします。

KobitoのファイルをDropboxで同期とる(Kobito2.2.0) を見ると、記事の入ったデータファイルを Dropbox 配下にハードリンクすれば良いとのこと。ただ、ファイル一個一個ハードリンクするのは面倒だし、ファイル名が変わったら動かなくなるのでディレクトリごとハードリンクすることにしました。Mac ではディレクトリにハードリンクするコマンドは用意されていません。

selkhateeb/hardlink というツールがあったので Homebrew で入れてみます。(ディレクトリのハードリンクは、循環参照する可能性があるので、注意しましょう!)

$ brew install hardlink-osx
==> Downloading https://homebrew.bintray.com/bottles/hardlink-osx-0.1.1.yosemite.bottle.tar.gz
######################################################################## 100.0%
==> Pouring hardlink-osx-0.1.1.yosemite.bottle.tar.gz
==> Caveats
Hardlinks can not be created under the same directory root. If you try to
`hln source directory` to target directory under the same root you will get an error!

Also, remember the binary is named `hln` due to a naming conflict.
==> Summary
🍺  /usr/local/Cellar/hardlink-osx/0.1.1: 3 files, 20K

こんな感じでできました。

$ cd ~/Dropbox
$ hln ~/Library/Containers/com.qiita.Kobito/Data/Library/Kobito Kobito

ハードリンクについてよく知らなかったので調べたのですが、普通のファイルもハードリンクなんですね。Dropbox からしたら普通のディレクトリと変わりないので、バックアップもできるわけですね。

14
11
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
14
11