设置一个crontab以自动在屏幕上启动Fivem服务器
我正在尝试建立一个自动化的crontab,以使用TxAdmin启动我的Fivem服务器。这就是我目前所拥有的:
@reboot screen +set serverProfile FWRP_Server1 /[path]/run.sh
@reboot screen +set serverProfile FWRP_Training +set txAdminPort 40121 /[path]/run.sh
@reboot screen +set serverProfile FWRP_FivePD +set txAdminPort 40122 /[path]/run.sh
它没有启动屏幕。我认为我的问题是双重的。首先,我不确定将设置参数放在哪里。如果我要手动执行此操作,则直接在 /run.sh之后的正常位置,但这不起作用。其次,在执行下一个服务器之前,我需要以某种方式从屏幕上脱离屏幕,因为您必须在手动运行它时进行操作?
任何指导都将不胜感激。
I am trying to set up an automated crontab to start my FiveM servers usingtxAdmin. This is what I currently have:
@reboot screen +set serverProfile FWRP_Server1 /[path]/run.sh
@reboot screen +set serverProfile FWRP_Training +set txAdminPort 40121 /[path]/run.sh
@reboot screen +set serverProfile FWRP_FivePD +set txAdminPort 40122 /[path]/run.sh
It's not starting the screens. I think my problem is twofold. First I'm not sure where to put the set parameters. The normal spot for this one is directly after the /run.sh if I were to do it manually but that didn't work. Second, do I need to detach from the screen somehow for the first line before doing the next server since you have to so that when running it manually?
Any guidance would be much appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我的人物曾经写过这样的狂欢
,所以我认为您可以在其中写下所有命令,然后用crontab启动此脚本。你有尝试吗?
使用您的代码,
使用-DMS屏幕命令将用于启动带有命令的独立屏幕。要重新启动屏幕,就这样做:
编辑1
批处理文件就像
/your/path/launch_fivem.sh
是内容
,在crontab上,您可以添加
Personnaly i have writen a bash like this
so, i think you can just written a bash with all your command on it and launch this script with crontab. Do you have trying this ?
With your code that doing this
The screen command with -dmS is for launch a detached screen with the command. To reattach the screen just doing this :
EDIT 1
The batch files is like this
/your/path/launch_fivem.sh
is content
and on crontab, you add