0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

計算が終わったらLINEに通知が行くようにした方法

0
Posted at

計算機で長めの計算を流すときに、それが終わったら(正常終了でもエラーでも)LINEで通知を受け取ることができる方法を試してみた。
参考にしたのはこちら
なお、ぼそっとつぶやいたら即座にやり方を調べて提案してくれたAさんにも感謝したい。

LINE Notifyのトークン発行

LINE Notifyを友だち追加。
同じページでログイン。
右上の名前からマイページ。
トークンを発行。

コマンド

メッセージを即座に送りたい

計算機に打つコマンドは以下の通り。

curl -X POST -H 'Authorization: Bearer トークン' -F 'message=メッセージ' https://notify-api.line.me/api/notify

トークンには発行したものを、メッセージは日本語でもOK。

計算が終わったらメッセージを受け取りたい

他にもやり方はありそうだが、とりあえず使えそうなものは以下のコマンド。

(nohup time ./test >./out.log 2>./err.log </dev/null; curl -X POST -H 'Authorization: Bearer トークン' -F 'message=test終わったよ' https://notify-api.line.me/api/notify) &
0
1
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
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?