Answer the question
In order to leave comments, you need to log in
How to play files from bash script?
I made such a script for reminders, and placed it in crontab.
#!/bin/bash
...
/usr/bin/RHVoice-client -v 1 -s Anna+CLB < /tmp/text.txt | aplay
#крон
* * * * * /home/usrname/dir/sh1 > /tmp/sh1.log 2>&1
ALSA lib pcm_dmix.c:1089:(snd_pcm_dmix_open) unable to open slave
aplay: main:852: audio open error: Device or resource busy
Answer the question
In order to leave comments, you need to log in
Oh my god I solved it.
It is necessary to crontab -e
add in the XDG_RUNTIME_DIR=/run/user/$(id -u)
script before the script.
I ran:
* * * * * /home/usr/dir/sh1 > /tmp/sh1.log 2>&1
And it is necessary:
* * * * * XDG_RUNTIME_DIR=/run/user/$(id -u) /home/usr/dir/sh1 > /tmp/sh1.log 2>&1
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question