Hi all,
I am trying to get OBS to launch from a cron job, I'm running Debian, my crons run from crontab. What I am trying to achieve is to start a broadcast by getting OBS to start at a particular time.
I am able to do this with a command line script and it works fine, but if I try and run it from a cron, it just wont launch and I can't for the life of me understand why or what the difference is.
This is the script I can run to launch it from command line:
#!bin/bash
su user1 -c "/usr/bin/obs --startstreaming > /dev/null 2>&1 &"
That is saved in a file startobs.sh (I have run chown +x startobs.sh)
If from command line if I run /bin/sh strartobs.sh it launches and starts streaming correctly.
However, if I try and run the following cron inside my crontab
0 0 * * * /home/user1/startobs.sh
It will not launch, the only glimpse of an error I have seen while trying to get it to work is this :
qt.qpa.screen: QXcbConnection: Could not connect to display
Could not connect to any X display
I have checked all the paths, tried running under root, everything I can think of.
I really have no idea why, anyone got any suggestions on how to resolve?
Thanks in advance.
I am trying to get OBS to launch from a cron job, I'm running Debian, my crons run from crontab. What I am trying to achieve is to start a broadcast by getting OBS to start at a particular time.
I am able to do this with a command line script and it works fine, but if I try and run it from a cron, it just wont launch and I can't for the life of me understand why or what the difference is.
This is the script I can run to launch it from command line:
#!bin/bash
su user1 -c "/usr/bin/obs --startstreaming > /dev/null 2>&1 &"
That is saved in a file startobs.sh (I have run chown +x startobs.sh)
If from command line if I run /bin/sh strartobs.sh it launches and starts streaming correctly.
However, if I try and run the following cron inside my crontab
0 0 * * * /home/user1/startobs.sh
It will not launch, the only glimpse of an error I have seen while trying to get it to work is this :
qt.qpa.screen: QXcbConnection: Could not connect to display
Could not connect to any X display
I have checked all the paths, tried running under root, everything I can think of.
I really have no idea why, anyone got any suggestions on how to resolve?
Thanks in advance.