SA-MP Forums Archive
Permission Denied, not for the people who can answer me though. - 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: Permission Denied, not for the people who can answer me though. (/showthread.php?tid=174928)



Permission Denied, not for the people who can answer me though. - Geso - 07.09.2010

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?


Re: Permission Denied, not for the people who can answer me though. - Killerkid - 07.09.2010

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


Re: Permission Denied, not for the people who can answer me though. - Geso - 07.09.2010

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


Re: Permission Denied, not for the people who can answer me though. - Cool_Boy27 - 13.11.2010

Cheers killerkid worked