0

If i run rsync inside screen, then after while i can login to server and attach detached screen. Now i want to run rsync from crontab. I added entry to crontab: 03 19 * * * root /usr/bin/screen -dmS rsyncSess uptime after crontab executes command, i run screen -ls. nothing listed. after i run command: /usr/bin/screen -dmS rsyncSess watch -n 5 uptime i can see that session when run command: screen -ls

How i can run script in screen from crontab and then attach that screen session to see output of rsync (even after rsync are finished)?

Until now i found this tread: https://askubuntu.com/a/15291

4

1 回答 1

0

确保你:

  • screen -ls以 crontab 用于启动命令的同一用户身份运行
  • 使用在重新连接之前不会结束的主命令,因为这也会结束您的会话。如果您运行一个简短的命令并希望会话持续存在,请使用类似的东西(或者,如您提到的链接bash -c 'short_command; exec bash'中所指出的,添加到您的)。defzombie ZZ.screenrc
于 2013-11-13T17:46:08.433 回答