Linux 进程未从cron下的脚本运行
我的cron计划是:Linux 进程未从cron下的脚本运行,linux,bash,cron,Linux,Bash,Cron,我的cron计划是: * * * * * /home/sa-mp/samp03/fix.sh 我的剧本是: #!/bin/bash if ! pgrep samp03svr; then /home/sa-mp/samp03/samp03svr & echo "$(date): Process start" >> /home/sa-mp/samp03/restart_log.txt fi 在手动调用脚本时,它可以正常工作,但当cron调用该脚本时,进程“sam
* * * * * /home/sa-mp/samp03/fix.sh
我的剧本是:
#!/bin/bash
if ! pgrep samp03svr; then
/home/sa-mp/samp03/samp03svr &
echo "$(date): Process start" >> /home/sa-mp/samp03/restart_log.txt
fi
在手动调用脚本时,它可以正常工作,但当cron调用该脚本时,进程“samp03svr”不会运行
脚本和进程的权限为755
var/log/cron.log中的行:
/USR/SBIN/CRON[3662]: (root) CMD (/home/sa-mp/samp03/fix.sh)
试着这样做:
* * * * * /home/sa-mp/samp03/fix.sh > /home/sa-mp/samp03/fix.sh.out
请告诉我们什么是samp03svr。这只会创建一个空的fix.sh.out文件。samp03svr是游戏服务器。