我在中放置了一个可执行脚本/etc/cron.hourly,但是该脚本并非每个小时都运行一次,实际上根本就没有运行过。
这是我制作的脚本(小时声音):
#!/ bin / bash mplayer〜/ Music / sfx_msg-highlight.wv&> / dev / null& spd-say -r -50 -p 50 -t male3“现在的时间是$(date +”%l%p“)” notify-send“这是:”“ $(date +”%l%p“)。” -i〜/ Pictures /“ first tee.png” -t 5000
我的crontab是:
DISPLAY=":0.0"
XAUTHORITY="/home/naruto/.Xauthority"
XDG_RUNTIME_DIR="/run/user/1000"
0 * * * * /home/naruto/Hour-sound.sh虽然mplayer和spd-say命令正常运行时,notify-send是不是。我还尝试将错误重定向到文件:
0 * * * * /home/naruto/Hour-sound.sh 2>/tmp/error但这没有输出。我究竟做错了什么?
/etc/crontab文件也行17 *    * * *   root    cd / && run-parts --report /etc/cron.hourly?
                
/etc/crontab有run-parts用于cron从目录运行每小时作业的行?