On 7/16/22, Roger Price wrote: > People occasionally have a cron job emit some sound each hour. On my Debian > 9 > machine I hear Biff [1] barking. In /etc/crontab I have an entry to call a > script bark.sh which does the barking. Typically > > 0,1 0,12 * * * rprice full-path-to/bark.sh 12 2>>&1 > > where bark.sh is a Bash script which calls /usr/bin/play to play a .au > file. > > This ran for years with Debian 9. I upgrade to Debian 11 and hear nothing. > The > usual advice is > (a) in /etc/crontab export XDG_RUNTIME_DIR=/run/user/1000 > (b) play the sound from a script. > > But that doesn't work with Debian 11. Does any reader of this list have > sound > coming from a Debian 11 cron job? If so, how is it done?
I don't have play, so I tried aplay .. and it works, even if I'm logged out, even if someone else is logged in. ## run the script every minute $ crontab -l | tail -3 # m h dom mon dow command * * * * * /home/lee/bin/neener.sh ## which plays a .wav and an .au file $ cat ~/bin/neener.sh #!/bin/sh /usr/bin/aplay -q $HOME/Sounds/Old/NEENER.WAV sleep 0.25 /usr/bin/aplay -q $HOME/Sounds/SunOS/busy.au Lee