07.11.2013, 14:08
I want to install a script that auto restarts my server if it goes offline.
I tride using https://sampwiki.blast.hk/wiki/Linux_Server#Method_2
But Something seems to be going wrong. I keep getting this error when i use nohup ./restart.sh &
My restart.sh is as follows:
My SAMP Directory on my VPS:
NOTES: I have the correct permissions set, the paths look alright, and yes i can start my server using ./samp03svr &
Any/all help would be GREATLY appreciated!
I tride using https://sampwiki.blast.hk/wiki/Linux_Server#Method_2
But Something seems to be going wrong. I keep getting this error when i use nohup ./restart.sh &
Quote:
nohup: ignoring input and appending output to `nohup.out' nohup: failed to run command `./restart.sh': No such file or directory |
Quote:
#!/bin/sh log=samp.log dat=`date` samp="/root/samp03" cd /root/samp03 echo "${dat} watchdog script starting." >>${log} while true; do echo "${dat} Server exited, restarting..." >>${log} mv /root/samp03/server_log.txt /root/samp03/logs/server_log.`date '+%m%d%y%H%M%S'` ${samp} >> $log sleep 2 done |
NOTES: I have the correct permissions set, the paths look alright, and yes i can start my server using ./samp03svr &
Any/all help would be GREATLY appreciated!