I'm having a heck of a time getting a tmux session to be created from a script executed by crontab. The script executes and the session is created without fail from just running it but if I run it from crontab the session isn't created and it doesn't run.
Cron command looks like:
That script just has this one line in it.
sudo /usr/bin/tmux new-session -d -s mysession 'bash /home/pathtolaunchscript.sh'
Inside that other script is an application that just runs and does its thing.
I've made sure it's executing as the right user (in my case I'm testing as sudo) and even if I couldn't find the session I'd be able to tell if it was running anywhere by virtue of the application.
Don't really know what else to try. Other cron operations work besides this one and the scripts work outside of crontab. Thanks in advance
Edit 1: It was asked if it worked executing sleep, so I ran the following but it didn't create the session either.
sudo /usr/bin/tmux new-session -d -s mysession 'sleep 1000'
Edit 2: All paths in the scripts and in cron are complete, absolute paths.