Support #729

audtool not working using cron
0%
Description
Hello guys !
I'm trying to get information from audtool, but it doesn't work using cron schedule.
I'm on Archlinux 4.11.7-1-ARCH
Step to reproduce :
1/ Start Audacious, and play some audio files -should be already done :)
2/ Take the script in attachment and put it in /tmp
. Make it executable (chmod +x
)
3/ Execute it : you get something like :PID Audacious : 3362
audstat : playing
paused : 1
playing : 0
4/ do an crontab -e
and put a line :*/1 * * * * /tmp/test_cron_audtool.sh > /dev/null
5/ Wait next cron execution, and check the content of /tmp/aud-status
. I have :PID Audacious : 3362
audstat :
paused : 1
playing : 1
-> This is not expected, I should get same as 3/
As I get some values, there's no errors in cron, and audtool is executed (getting paused
and playing
values, even if they're wrong).
Any ideas ?
P.S. : delete the line in your cron.
History
#1
Updated by John Lindgren almost 8 years ago
- Tracker changed from Bug to Support
Are you running the cron job from the same D-Bus session as Audacious?
#2
Updated by Anonymous almost 8 years ago
Well, audacious and my crontab -e
are on the same session. How can I check that d-bus session is the same ?
#3
Updated by John Lindgren almost 8 years ago
Sylvain LABOISNE wrote:
Well, audacious and my
crontab -e
are on the same session. How can I check that d-bus session is the same ?
echo $DBUS_SESSION_BUS_ADDRESS
#4
Updated by Anonymous almost 8 years ago
unix:path=/run/user/1000/bus
1000 is me according to /etc/passwd
#5
Updated by John Lindgren almost 8 years ago
That's set in your cron script as well?
#6
Updated by Anonymous almost 8 years ago
Do I need to put something else to set dbus session ?
I tried :DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus;/to/my/script > /dev/null
No better results.
#7
Updated by John Lindgren almost 8 years ago
I'm not sure if it will solve the issue, but I think you need to remove the semicolon in the middle of that command.
#8
Updated by Anonymous almost 8 years ago
My mistake.
Indeed, it works now, the problem comes from the cron job that don't know my dbus session, putting that in crontab -e
fixed it :
*/1 * * * * DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus /path/to/my/script
To know what to put after the "=", do a :
echo $DBUS_SESSION_BUS_ADDRESS
Thanks for help and for this great media player ! You can close this support issue.
#9
Updated by John Lindgren almost 8 years ago
- Status changed from New to Closed