If I run rsync inside screen
, then after a while I can login to the server and attach the detached screen
.
Now I want to run rsync from crontab
. I added this entry to crontab:
03 19 * * * root /usr/bin/screen -dmS rsyncSess uptime
After crontab executes the command, I run screen -ls
but nothing is listed.
After I run /usr/bin/screen -dmS rsyncSess watch -n 5 uptime
I can see that session when run screen -ls
.
How can I run a script in screen
from crontab
and then attach that screen session to see the output of rsync (even after rsync is finished)?
Until now I found this tread.
Make sure you:
screen -ls
as the same user that is used by crontab to start your commandbash -c 'short_command; exec bash'
(or, as pointed out in the link you mention, add defzombie ZZ
to your .screenrc
).