Linux Server Restart Help
#1

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
Reply
#2

Would be greatly appreciated if anyone knew.
Reply
#3

I shouldn't bump but I really need some help.
Reply
#4

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)