完整的音频文件及脚本: Github
参考链接:
http://blog.sina.com.cn/s/blog_6d1aef300100qta0.html
http://linuxtools-rst.readthedocs.org/zh_CN/latest/tool/crontab.html
#!/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
crontab -e
添加如下代码0 * * * * /usr/local/bin/TimeAudio.sh
还没有人评论,抢个沙发吧...