I like to run a cron that snapshots a cam like this:
* 9-17 * * 1-5 vlc -I dummy v4l2:///dev/video0 --video-filter scene --no-audio --scene-path /home/foo/tmp/cam --scene-prefix snapshot --scene-format png vlc://quit --run-time=1
But when the cron runs it just throws an error I don't understand:
** Message:
Failed to get session bus:
Error spawning command line 'dbus-launch --autolaunch=55644972b3c91c1d24d83d8252721f00 --binary-syntax --close-stderr':
Child process exited with code 1
In the web I find no clean or good documentation what that is. Can you help me figure it out?
From what I can tell, you may need to either:
Set the display variable (Note that it might not be 0, could be 1 or even 2):
Launch a dbus-session:
Set the dbus variable:
In your case with a Cron job you can set environment variables like this:
So for option 1 your job would look like this:
For option 2 you can separate the two commands using &&, like this:
Something similar for option 3: