Ubuntu8.04. Crontab is a tool used to regularly run programs in Linux. Edit the following shell script mp3.sh :#! /Bin/shmplayer/home/administrator/Others/mp3/lanlianhua.mp3 give executable properties through chmodu + x. You can play a song through./mp3.sh on the command line. However, if you use crontab
Ubuntu 8.04. Crontab is a tool used to regularly run programs in Linux. Edit the following shell script mp3.sh:
#! /Bin/sh
Mplayer/home/administrator/Others/mp3/lanlianhua.mp3
Execute attributes using chmod u + x. You can play a song through./mp3.sh on the command line. However, if you use crontab-e to edit a scheduled file
15 */home/administrator/mp3.sh
That is to say, it is impossible to play a song at 15th minutes every hour.
Later, I looked around on the Forum and said I needed to set the display device for the gui program: for example:
Realplay export DISPLAY =: 0/home/administrator/Others/mp3/lanlianhua.mp3
I tested it. It is true. However, realplay is acceptable, but mplayer is still not.
Finally, mplayer/home/administrator/Others/mp3/lanlianhua.mp3>/dev/null
I don't know why. ? In this case, do not assign a console to mplayer?
In any case, the problem is solved.