I have a script that executes perfectly fine manually, though two commands in particular are completely ignored by Cron (this is just a snippet):
sinkint=$(pacmd list-sinks | sed -n '/index\W [1-9]/p' | sed 's/.*://g;s/\W//g')
pacmd set-default sink $sinkint
pacmd set-sink-volume $sinkint 20%
I have a feeling it has something to do with the builtin function "set", so I've tried adding a path and using "env pacmd..." for both of the commands, though no luck. I've also tried "$(pacmd...)", as well as disabling the builtin with "enable -n set" - also tried setting the interpreter to sh instead of bash.
Any help on this would be greatly appreciated, I'm completely lost.
Edit: crontab
* * * * * /path/to/script arg1 >> /path/to/log
Edit: error messages
No PulseAudio daemon running, or not running as session daemon.
No PulseAudio daemon running, or not running as session daemon.
You have to specify a sink name/index and a volume