小编Ahm*_*mdy的帖子

使用crontab在@reboot上运行"screen -S name ./script"命令

我已经尝试将此添加到我的crontab:

@reboot/root/startup

"启动"文件:

#!/bin/sh

svnserve -d -r /root/svnrepos/mainres
svnserve -d -r /root/svnrepos/mapres --listen-port=3691
screen -S mta ./mtaserver/mta-server > log1
screen -S mapmta ./mapserver/mta-server > log2

exit 0
Run Code Online (Sandbox Code Playgroud)

现在svnserve命令运行正常.问题在于screen命令.

log1和log2文件具有相同的内容:必须连接到终端.

我要做的是在启动时启动2个可执行文件,然后再有办法访问它们.

有没有办法做到这一点?

linux cron reboot gnu-screen

4
推荐指数
1
解决办法
8013
查看次数

标签 统计

cron ×1

gnu-screen ×1

linux ×1

reboot ×1