Jump to content

Need help with Crontab


noesges97

Recommended Posts

Hello.

I want to use Crontab to restart my Server. 

But it dont work and i dont know why. 

 

I saw this and tried it for hours.  https://github.com/deannreid/BattlEye-RCON-Control-PHP#for-webmin

 

Here is my crontab

 

0 0,4,6,9,12,15,18,21 * * * cd /home/epoch/server/restarter.pl #restart
10,30,50 0-1 * * * php -q /home/epoch/server/Restart/resinf.php  #Restart Information
0 1,4,7,10,13,16,19,22 * * * php -q /home/epoch/server/Restart/2hr.php  #2 Hour Restart Warning
0 2,5,8,11,14,17,20,23 * * * php -q /home/dayzservers/epochchernarus/Restart/1hr.php  #1 Hour Restart
30 2,5,8,11,14,17,20,23 * * * php -q /home/epoch/server/Restart/30min.php   #30 Min Restart
45 2,5,8,11,14,17,20,23 * * * php -q /home/epoch/server/Restart/15min.php    #15 Min Restart
50 2,5,8,11,14,17,20,23 * * * php -q /home/epoch/server/Restart/10min.php     #10 Min Restart
55 2,5,8,11,14,17,20,23 * * * php -q /home/epoch/server/Restart/5min.php      #5 Min Restart
59 2,5,8,11,14,17,20,23 * * * php -q /home/epoch/server/Restart/1min.php        #1 Min Restart

 

The Server dont restarts. I have to activate something that the sheduler run? 

And i tried to run the php scipts manual with php ./5min.php and it freezes here:  Got Socket! Attempting Login

 

Pls help me. 

Greetings

 

Link to comment
Share on other sites

0 0,4,8,12,16,20 * * * /home/epoch/serverdownloads/epoch/restarter.pl

I you use that in me crontab and the server restarts every 4 hours

 

you have a 

cd

in front of the restart, that way youre telling your server to change his current folder to this one but it wont execute anything.

remove the cd and you should be fine

 

 

 

 

Link to comment
Share on other sites

Also note that if you haven't set the path in restarter.pl, then running that command won't work. Just open up restarter.pl, and on line 11 (might be slightly different for you), change it to:

use constant PATH    => '/home/epoch/server/';

Then, as Swordsworn said, remove the cd from your command. Your current command will try to navigate to restarter.pl as if it were a folder, rather than executing it.

EDIT:

You should also modify the times at which it will run each PHP file, since a couple don't line up with your restart times.

Edited by Zer0HD2
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Discord

×
×
  • Create New...