title: How to prevent "screen -dmS sessionName program.sh" from disappearing after program.sh finishes?
body: <p>If I run rsync inside <code>screen</code>, then after a while I can login to the server and attach the detached <code>screen</code>.</p>
  <p>Now I want to run rsync from <code>crontab</code>. I added this entry to crontab:</p>
  <pre><code>03 19 * * *     root /usr/bin/screen -dmS rsyncSess uptime
  </code></pre>
  <p>After crontab executes the command, I run <code>screen -ls</code> but nothing is listed.</p>
  <p>After I run <code>/usr/bin/screen -dmS rsyncSess watch -n 5 uptime</code> I can see that session when run <code>screen -ls</code>.</p>
  <p>How can I run a script in <code>screen</code> from <code>crontab</code> and then attach that screen session to see the output of rsync  (even after rsync is finished)?</p>
  <p>Until now I found <a href="https://askubuntu.com/a/15291">this tread</a>.</p>