Skip to content

Instantly share code, notes, and snippets.

@ongaeshi
Last active December 12, 2015 09:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ongaeshi/4748817 to your computer and use it in GitHub Desktop.
Save ongaeshi/4748817 to your computer and use it in GitHub Desktop.
QiitaMailをマシンがスリープした状態でも毎日送信してくれるように設定
  1. qiita_mail Gem のインストール gem install qiita_mail
  2. qiita_mail deliver が実行出来るようにする、詳しくは QiitaMailの使い方 - Qiita
  3. 「省エネルギー」に「スケジュール」→スリープ解除「毎日」「4:59」
  4. qiita_mail_and_sleep~/binに配置
  5. ログ置き場のための~/tmpを作成
  6. crontab -e で毎日5:00にqiita_mail_and_sleepを実行するようにする
  7. sleepでウェイトをいれるのがこつ
# min hour mday month wday command
0 5 * * * /Users/a_user/bin/qiita_mail_and_sleep
# send mail
/opt/local/bin/qiita_mail deliver >> /Users/a_user/tmp/qiita_mail.log
# Wait send mail
sleep 60
# sleep
osascript -e 'tell app "Finder" to sleep'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment