Cron job is not running

Hello everyone. I need some assistant.

Here is my cron job:

0 19 * * * ~/.config/waybar/modules/nighttime.sh >> ~/Documents/cronlog 2>&1

And here is my script:

#!/bin/bash

# Checking the time of day
timeofday=$(date +%^P)

# change gamma, brightness and temperature

export DBUS_SESSION_BUS_ADDRESS=$DBUS_SESSION_BUS_ADDRESS XDG_RUNTIME_DIR=$XDG_RUNTIME_DIR

	if [ $timeofday != 'am' ]; then
		busctl --user -- call rs.wl-gammarelay / rs.wl.gammarelay UpdateBrightness d -0.2
		busctl --user -- call rs.wl-gammarelay / rs.wl.gammarelay UpdateGamma d 0.4
		busctl --user -- set-property rs.wl-gammarelay / rs.wl.gammarelay Temperature q 4500
	else
		busctl --user -- set-property rs.wl-gammarelay / rs.wl.gammarelay Brightness d 1
		busctl --user -- set-property rs.wl-gammarelay / rs.wl.gammarelay Gamma d 1
		busctl --user -- set-property rs.wl-gammarelay / rs.wl.gammarelay Temperature q 6500	
	fi

If I launch this script from the terminal, it does what I want it to do, but cron gives me errors - failed to connect to bus: connection refused.

I am using Hyprland WM, meaning Wayland. I found a few articles for X11, but they do not work for me. Any help is appreciated, thanks.

I got it to work. For anyone who is interested, That what was my mistake, I cannot export the variable, i.e. - $DBUS_SESSION_BUS_ADDRESS, I have to export the actual address inside my shell script:

export DBUS_SESSION_BUS_ADDRESS="unix:path=[your path]" XDG_RUNTIME_DIR="[your path]"

Hope it helps someone.