OneDrive を Ubuntu で使う

先日Ubuntu 64bit で使おうというヤツ

※ なんで Windows なもので・・・()

UbuntuでOneDriveを使う – Qiita
を参考に情報の最新化や整理など加筆修正しました。有用な記事のご提供誠にありがとうございます。

まずはここに書かれてある通り必要な環境を整備します。

① 必要なライブラリと D 言語のコンパイラ導入

$ sudo apt-get install libcurl4-openssl-dev libsqlite3-dev gdebi
$ cd /tmp
$ wget http://downloads.dlang.org/releases/2.x/2.092.1/dmd_2.092.1-0_amd64.deb
$ sudo gdebi dmd_2.092.1-0_amd64.deb

OneDrive Client for Linux をコンパイル&インストールする

$ cd /tmp
$ git clone https://github.com/abraunegg/onedrive.git
$ cd onedrive
$ ./configure
$ make
$ sudo make install

③ サンプル設定ファイルをコピーする

$ mkdir -p ~/.config/onedrive
$ cp -p /tmp/onedrive/config ~/.config/onedrive/

④ 設定ファイルを編集する

$ vi ~/.config/onedrive/config

※ ファイル保存ディレクトリ sync_dir 以外は特に設定変更しなくても大丈夫かも

⑤ いったん手動で起動し、認証情報を設定する

$ onedrive
Configuration file successfully loaded
Configuring Global Azure AD Endpoints
Authorize this app visiting:

https://login.microsoftonline.com/common/oauth2/v2.0/authorize(
以下略) Enter the response uri:

 ・Authorize this app visiting に表示された URL にブラウザでアクセスする

 ・Microsoft 365の認証画面が出てくるので、ID/Password を入力する

 ・認証が成功すると白紙のページが表示されるので、白紙ページの URL をそっくりそのままコピーして↑の Enter the response uri: のあとに貼り付けて Enter キーを押下する

⑥ サービスの起動設定(ユーザモードで自動起動させる)

$ systemctl --user enable onedrive
$ systemctl --user start onedrive

以上で更新を自動検知してファイルの同期を行ってくれるように成増・・・ってなぜにウチのATOKは「なります」を「成増」にしたがるのかw

※板橋区民だけど成増在住ではないです()

コメント

タイトルとURLをコピーしました