• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Fully autommaticly system linux ?

Pietia

Active Member
Joined
Jan 13, 2008
Messages
2,147
Reaction score
48
Location
Poland
is there any way to do it automatticly ?
Save of ots and shutdown the ots at 2.50 am 2.52 restart of whole server i mean dedicated 2.55 run on restarted server again ots with
#!/bin/bash
ulimit -c unlimited
while true; do ./theforgottenserver; done
how to do somthing like that ? my os linux (ubuntu).
i know that the first part can be doned by config.lua but what about next ?
 
Try....
In your shell type: crontab -e

Add:
Code:
52 2 * * * root sh /home/ot/script.sh
55 2 * * * root sh /home/ot/otstart.sh
Save file and test.
 
Last edited:
Try....
In your shell type: crontab -e

Add:
Code:
52 2 * * * root sh /home/ot/script.sh
55 2 * * * root sh /home/ot/otstart.sh
Save file and test.

by shell u mean console right ? and also what i have to change here?
55 2 * * * root
what means 55 2 ** and all other ? root are privlage of root user or what ??
 
Try with:
Code:
55 2 * * * root /home/ot/otstart.sh /dev/tty1

still not working let i gave u what i have typed exacly .
Code:
50 17 * * * root /home/admin/otstart.sh /dev/tty1
this means that at 17 50 the script which is located up should run right ?
in otstart.sh for example i have wrote
Code:
cd vt
./ventrilo_srv
and this script don't runned ... when i run that on admin console it run normal so this is not chmod problem ...
 
Code:
50 17 * * * root /home/admin/otstart.sh /dev/tty1
this means that at 17 50 the script which is located up should run right ?
Yeap!!

in otstart.sh for example i have wrote
Code:
cd vt
./ventrilo_srv
and this script don't runned ... when i run that on admin console it run normal so this is not chmod problem ...
Yeap!!

You test your script manually? Its works?
 
Strange, that is to schedule their tasks.
I will try to see another form of this work for you.

PS: What version of Ubuntu you use? Or if you use Windows by PuTTy?
 
I restart my server every day automaticaly easier.
In config.lua set in globalsave hour 2.50 and wirte yes to shutdownatserversave.
Don't forget to use restarter (I can give you one), so it will start up.

Restarter:
PHP:
#! /bin/bash
cd /home/ots

i=1
while [ $i -le 99999000 ]
do
./TheForgottenServer > ./data/output.txt
i=`expr $i + 1`
done

and I also use executor to start restarter in screen:
PHP:
echo Starting OTS....
sleep 1
screen -A -m -d -S ots ./start-ots
 
I restart my server every day automaticaly easier.
In config.lua set in globalsave hour 2.50 and wirte yes to shutdownatserversave.
Don't forget to use restarter (I can give you one), so it will start up.

Restarter:
PHP:
#! /bin/bash
cd /home/ots

i=1
while [ $i -le 99999000 ]
do
./TheForgottenServer > ./data/output.txt
i=`expr $i + 1`
done

and I also use executor to start restarter in screen:
PHP:
echo Starting OTS....
sleep 1
screen -A -m -d -S ots ./start-ots

i don't see any restart of whole server like u do in ovh by command
sudo /sbin/reboot it's like rl tibia do and it's for gain some of wasted ram resources.so i think that ur script won't help me...
restarter not better do like that ?
#!/bin/bash
ulimit -c unlimited
while true; do ./theforgottenserver; done
 
Haha :)
Wasted RAM ? So what you're doing with your server ?
Serwer uruchomiony od: 123 dzień(dni) 2 godzina(y) 18 minuta(y) 40 sekunda(y)

Średnie obciążenie ( loadavg1 ) : 0.15
Średnie obciążenie ( loadavg2 ) : 0.08
Średnie obciążenie ( loadavg3 ) : 0.06
Aktywne procesy ( loadactive ): 5
Uruchomione procesy ( loadup ): 135
My server is running 123 days, 2h without restarting.

To restart your server automatically, just add reboot to my script, like this:
PHP:
#! /bin/bash
cd /home/ots

./TheForgottenServer > ./data/output.txt
sudo reboot

And don't forget to add TFS (or my starting script) to your startup:
Code:
sudo ln -s /home/ots/start.sh /etc/init.d/start-ots
sudo update-rc.d start-ots defaults
 
Haha :)
Wasted RAM ? So what you're doing with your server ?

My server is running 123 days, 2h without restarting.

To restart your server automatically, just add reboot to my script, like this:
PHP:
#! /bin/bash
cd /home/ots

./TheForgottenServer > ./data/output.txt
sudo reboot

And don't forget to add TFS (or my starting script) to your startup:
Code:
sudo ln -s /home/ots/start.sh /etc/init.d/start-ots
sudo update-rc.d start-ots defaults
where add it ?
Code:
sudo ln -s /home/ots/start.sh /etc/init.d/start-ots
sudo update-rc.d start-ots defaults
these lines ?
and when itype for example sudo /sbin/reboot the console will ask me about password so it won't work i think ...
edit: how do script known on which time he should be executed ?:> some masta of linux please help me xD
 
Last edited:
There is a problem whith cron, which won't start shell. It's ok when scripts are executing in background, but if you have to execute something in shell window cron crashes, so command screen won't be able in cron... i have the same problem, i'm trying to figure it out...
 

Similar threads

Back
Top