Raspberry Pi 整点报时

Raspberry Pi 整点报时

  参考链接:

  http://blog.sina.com.cn/s/blog_6d1aef300100qta0.html

  http://linuxtools-rst.readthedocs.org/zh_CN/latest/tool/crontab.html

  

  1.安装Mplayer

  2.下载语音文件(解压到/{home})

  3.创建脚本文件TimeAudio.sh(/usr/local/bin)

#!/bin/bash

filePath=/{home}/TimeAudio
Time=`date +%H%M`
audioFile="$filePath/$Time.mp3"
#echo $audioFile
player=/usr/bin/mplayer

$player $audioFile

  保存后加执行权限:

chmod +x /usr/local/bin/TimeAudio.sh

 

  4.加入定时计划 crontab

  运行:crontab -e 添加如下代码
  

0 * * * * /usr/local/bin/TimeAudio.sh

   

  v附录:语音文件

posted on 2016-03-30 15:47  忽而今夏  阅读(449)  评论(0编辑  收藏  举报