自动重启脚本 - bitgod520/titan GitHub Wiki

异常退出问题

由于titannetwork 服务端存在不稳定网络,我们的脚本可能会异常退出,如:

image

下面分享一些脚本来自动拉起挖矿程序

macos/linux 自动拉起脚本

while true;do
	./titan
done

windows 自动拉起服务

假设你的脚本在 F:\titan\titan.exe, 记事本新建,保存下面脚本的 为 titan.bat, 双击点击执行

start cmd /k "cd /d F:\titan && for /l %%x in (1,1,1000000) do titan.exe %%x"

supervisor

熟悉supervisor的用户,也可以安装supervisor, 服务配置参考:

root@localhost:~# cat /etc/supervisor.d/titan.ini
[program:titan]
directory=/root
command=/root/titan
stdout_logfile=/var/log/titan_1.log
stderr_logfile=/var/log/titan_1.err
autostart=true