Permission Denied, not for the people who can answer me though.
#1

Code:
Method 2
If you don't want to use crontab and if you want to have server log saved to a separate directory on server crash you can use this script.
To keep your server online using this script, first you need to stop your server and then execute it with this command:
nohup ./restart.sh &
restart.sh:
#!/bin/sh
log=samp.log
dat=`date`
samp="/path/to/samp/server/samp03svr"
cd /path/to/samp/server
 
echo "${dat} watchdog script starting." >>${log}
while true; do
        echo "${dat} Server exited, restarting..." >>${log}
        mv /path/to/samp/server/server_log.txt /path/to/samp/server/logs/server_log.`date '+%m%d%y%H%M%S'`
        ${samp} >> $log
	sleep 2
done
This method will bring your server back up whenever it crashes or when the RCON exit command is issued. It will also save the server log into a separate directory.
This is the method im using to keep my server up 24/7 on my vps, now the problem is, in the ssh console, when i type "nohup ./restart.sh &" it gives me the message:

Code:
[1] 1771
[root@vps***** samp03]# nohup: appending output to `nohup.out'
nohup: cannot run command `./restart.sh': Permission denied
Anyone got a clue?
Reply
#2

chmod +x restart.sh
Also don't run the server as root.
Reply
#3

Just started this afternoon, gotta learn it, thnx for the tip though
Reply
#4

Cheers killerkid worked
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)