I put an executable script in /etc/cron.hourly
, but that script didn't run every hour actually it never runs at all.
Here is the script(Hour-sound) that i made:
#!/bin/bash mplayer ~/Music/sfx_msg-highlight.wv &> /dev/null & spd-say -r -50 -p 50 -t male3 "The time now is $(date +"%l %p")" notify-send "It's: " "$(date +"%l %p") now." -i ~/Pictures/"first tee.png" -t 5000
My crontab is:
DISPLAY=":0.0"
XAUTHORITY="/home/naruto/.Xauthority"
XDG_RUNTIME_DIR="/run/user/1000"
0 * * * * /home/naruto/Hour-sound.sh
While the mplayer
and spd-say
commands are run correctly, the notify-send
is not. I also tried redirecting error to a file:
0 * * * * /home/naruto/Hour-sound.sh 2>/tmp/error
But that showed no output. What am I doing wrong?
/etc/crontab
has therun-parts
line for running hourlycron
jobs from the directory?/etc/crontab
file have the line17 * * * * root cd / && run-parts --report /etc/cron.hourly
?