On 1/24/25 16:58, Roger Price wrote:
>> On Fri, Jan 24, 2025 at 13:52:00 -0500, e...@gmx.us wrote:
>>> Maybe a difference in some software?  I ran
>>> eben@cerberus:~$ env - XDG_RUNTIME_DIR=/run/user/1000 /usr/bin/aplay
>>> /export/media/sounds/woow1.wav
>>> Playing WAVE '/export/media/sounds/woow1.wav' : Unsigned 8 bit, Rate 11025
>>> Hz, Mono
>>>
>>> and it worked.
>
> That works for me too, but not in cron.  Could you create a temporary personal
> cron job with crontab -e which sets
>
>  XDG_RUNTIME_DIR="/run/user/$(id -u)"
>
> and runs
>
>  M H * * * aplay /usr/share/sounds/alsa/Side_Left.wav
>
> where M is the minute 0-59 and H is the hour 0-23.  I shall do exactly the
> same.  Roger

OK.  My crontab has this:

XDG_RUNTIME_DIR="/run/user/$(id -u)"

# m h  dom mon dow   command
 *  *  24  1   *   aplay /export/media/sounds/woow1.wav

At the minute, no sound.  I tried
id=$(id -u)
XDG_RUNTIME_DIR=/run/user/$id

and
id=1000
XDG_RUNTIME_DIR=/run/user/$id

and no dice.  I tried
XDG_RUNTIME_DIR=/run/user/1000

and it worked.  Maybe this cron doesn't do variables in assignments?


Reply via email to