Starting OBS command line from cron

omega1

New Member
Hi all,

I am trying to start OBS from a cron command to start streaming and I'm struggling to get it working...

I can run a script from command line which works but when it runs from cron it does not and gives an error as follows:

qt.qpa.screen: QXcbConnection: Could not connect to display
Could not connect to any display


What is confusing me is that I can run it from command line and it works.

this is my command line :
#!bin bash
/usr/bin/obs --startstreaming > /dev/null 2>&1 &


Which is stored in startobs.sh

If I run ./startobs.sh it loads and starts streaming correctly.

If I try and run it from a cron as follows

* * * * * /bin/sh /path/startobs.sh

I can see it run at the correct time, but It gives me the above error in the log. I cannot for the life of me figure out why. All the paths are correct, etc... I've tried running the command from root and from the current user, same response.

Any ideas?

Thanks in advance!
 
Top