Hi guys,

We've been trying to make a cronjob to create a new session of tmux after 
reboot, so later after an ssh connection or directly with a screen located 
in /dev/tty1 we can attach the shown terminal to the already made session. 

After making a simple .sh to do so in "sudo crontab -e":
@reboot /bin/bash /home/USER/start.sh

With start.sh as
#!/bin/bash
/bin/sleep 5
source /home/debian/.bashrc
/usr/bin/tmux new-session -d -s session1
/usr/bin/tmux send-keys -t session1 "source /home/USER/.bashrc" C-m
/usr/bin/tmux send-keys -t session1 "echo \"hello\"" C-m

After connecting via ssh and doing "tmux attach-session -t session1" in 
that terminal we get the message "no sessions"

The opened terminal tty is "/dev/pts/1" when I run this script so I assume 
the usual "/dev/pts/0" is being occupied during the cronjob, but we find 
ourselves unable to access it. Any idea of what we are doing wrong?

Any help would be appreciated, Thanks!

-- 
You received this message because you are subscribed to the Google Groups 
"tmux-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/tmux-users/60a26273-02f3-4f9d-a460-a9f3c63b6634n%40googlegroups.com.

Reply via email to