Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
25
Help us understand the problem. What is going on with this article?
@horimislime

実行中のスクリプトが完了したらiPhoneにPush通知する

More than 5 years have passed since last update.

処理がなかなか終わらないスクリプトを放置しといて、出先で完了したら通知を受け取れないかな〜と思ったらすごく簡単だったのでメモ。
参考:Prowl+zshで快適お昼寝タイム - a lonely miner

コマンド実行が完了したらiPhoneにインストールしたim.kayacへcurlで通知を投げてみます。

スクリプトが実行完了したらim.kayacで通知
$ sh long_proc.sh && curl -d "message=おわったよ" http://im.kayac.com/api/post/[user_name]

スクリプトの後に&&で通知処理を繋げるだけ。

さらにスクリプトの標準出力内容も通知してみる。もうちょいキレイに書く方法ないかな。。

実行結果を通知
$ result=$(sh long_proc.sh) && curl -d "message=$result" http://im.kayac.com/api/post/[user_name]
25
Help us understand the problem. What is going on with this article?
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away

Comments

No comments
Sign up for free and join this conversation.
Sign Up
If you already have a Qiita account Login
25
Help us understand the problem. What is going on with this article?