title: How do I run a cron job that spawns a tmux session? (MacOS)
body: <p>I'm on MacOS Catalina. I'm trying to run a cron job that spawns a named tmux session with windows. Here is the <code>crontab -l</code>:</p>
  
  <pre><code>* * * * * cd /Users/dev/project; ./start.sh; ./poll 2&gt;&gt; /tmp/cron.out
  </code></pre>
  
  <p>However I don't see my session with <code>tmux ls</code>. In my error logs <code>cat /tmp/cron.out</code></p>
  
  <pre><code>./poll: line 3: tmux: command not found
  ./poll: line 5: tmux: command not found
  </code></pre>
  
  <p>This is the script I'm running. I have tmux installed for my user, and it works normally. When I execute <code>poll</code> normally, it works just fine.</p>
  
  <p>Here is <code>start.sh</code>:</p>
  
  <pre><code>#!/bin/bash
  
  tmux kill-session -t collect
  
  tmux new -s "collect" -d ./stuff
  </code></pre>