SA-MP Forums Archive
Linux Server Restart Help - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Server (https://sampforum.blast.hk/forumdisplay.php?fid=6)
+--- Forum: Server Support (https://sampforum.blast.hk/forumdisplay.php?fid=19)
+--- Thread: Linux Server Restart Help (/showthread.php?tid=103721)



Linux Server Restart Help - Gappy - 21.10.2009

Hey there, I've been trying to help a mate created a server restarter script, but as I have no experience with linux I have no idea why it isn't working.
This is what we have:

Код:
#!/bin/sh
log=samp.log
dat=`date`
samp="/home/SA-MP/MyServer/samp03/samp03svr"
cd /home/SA-MP/MyServer/samp03
 
echo "${dat} watchdog script starting." >>${log}
while true; do
    echo "${dat} Server exited, restarting..." >>${log}
    mv /home/SA-MP/MyServer/samp03/server_log.txt /home/SA-MP/MyServer/samp03/logs/server_log.`date '+%m%d%y%H%M%S'`
    ${samp} >> $log
	sleep 2
done
And i placed this script into my servers directory, And when i try to run the script this is the outcome:
Код:
> cd /home/SA-MP/MyServer/samp03
> nohup ./restart.sh &
nohup: cannot run command `./restart.sh': No such file or directory



Re: Linux Server Restart Help - Gappy - 21.10.2009

Would be greatly appreciated if anyone knew.


Re: Linux Server Restart Help - Gappy - 22.10.2009

I shouldn't bump but I really need some help.


Re: Linux Server Restart Help - Gappy - 22.10.2009

nvm I got it to work

I had to made the script on linux not on my PC as for some reason it didn't want to work if I made the script on my PC and uploaded it to the server.