maxdachs Posted May 23, 2014 Report Share Posted May 23, 2014 Hello, I tried to add this line with crontab -e on my server 0 0,4,8,12,16,20 * * * /home/arma2oa/restarter.pl and then I also tried 0 0,4,8,12,16,20 * * * cd / && /home/arma2oa/restarter.pl But the server does not restart. My path in restarter.pl is: use constant PATH => $ENV{'PWD'}.'/'; # Set your epoch server dir With this I can restart the server manually But when I change the path in restarter.pl to this: /home/arma2oa/ (the path where all files are), it says: Can't found server binary! I hope someone can help me! Link to comment Share on other sites More sharing options...
sjd6795 Posted May 23, 2014 Report Share Posted May 23, 2014 Not sure never restarted a server with that method before. Give this a read and try it. http://ibattle.org/install-and-configure/ Link to comment Share on other sites More sharing options...
maxdachs Posted May 23, 2014 Author Report Share Posted May 23, 2014 I have a Linux Server and I dont know how to install BEC with wine and I also dont know if its working with a Linux Server and a wine BEC. Link to comment Share on other sites More sharing options...
jahangir13 Posted May 23, 2014 Report Share Posted May 23, 2014 What *nix do you have? The crontab entries sometime look a bit different. # m h dom mon dow command 0 */4 * * * /home/dayzepoch/server1042/restarter.pl >> /home/dayzepoch/server1042/restart.log 2>&1 Log to a file like I do so you can see if there are messages (like binary not found or something). Or check your mails with 'mail' to see if you see the error messages there. Link to comment Share on other sites More sharing options...
maxdachs Posted May 23, 2014 Author Report Share Posted May 23, 2014 Im using Ubuntu 12.04, when i do this the restart.log will not be created. Link to comment Share on other sites More sharing options...
DeanReid Posted May 24, 2014 Report Share Posted May 24, 2014 I personally make sure I set to / first to stop binary errors Here is my one currently set to 3 hour restarts 0 0,3,6,9,12,15,18,21 * * * cd / && /home/dayzservers/epochchernarus/restarter.pl >> /home/dayzservers/epochchernarus/restart.log 2>&1 May I suggest you install webmin to your server if possible. It makes it easier to create cron jobs in my opinion Looks like that :) Link to comment Share on other sites More sharing options...
maxdachs Posted May 24, 2014 Author Report Share Posted May 24, 2014 Ok, when I change the path to /home/arma2oa/ in restarter.pl it works, but I cant restart it manually then (must change the path before to /) But Thank you for your help! Link to comment Share on other sites More sharing options...
jahangir13 Posted May 24, 2014 Report Share Posted May 24, 2014 You just need to set a absolute path in your restarter, that's all (did oversee your restarter line in the OP). restarter.pl: ###use constant PATH => $ENV{'PWD'}.'/'; # Set your epoch server dir use constant PATH => '/home/dayzepoch/server1042/'; cron: 0 */4 * * * /home/dayzepoch/server1042/restarter.pl >> /home/dayzepoch/server1042/restart.log 2>&1 It's always a good idea to use absolute paths in my opinion.So you can execute a script independantly in which directory your user currently is. @DeanReid: I guess the root user in your screen was just an example? ;) Link to comment Share on other sites More sharing options...
DeanReid Posted May 24, 2014 Report Share Posted May 24, 2014 @DeanReid: I guess the root user in your screen was just an example? ;) Shh, I'm a rebel and use root XD Edit: I mean, I don't use root at all, Root is bad :o Link to comment Share on other sites More sharing options...
maxdachs Posted May 24, 2014 Author Report Share Posted May 24, 2014 You just need to set a absolute path in your restarter, that's all (did oversee your restarter line in the OP). restarter.pl: ###use constant PATH => $ENV{'PWD'}.'/'; # Set your epoch server dir use constant PATH => '/home/dayzepoch/server1042/'; cron: 0 */4 * * * /home/dayzepoch/server1042/restarter.pl >> /home/dayzepoch/server1042/restart.log 2>&1 It's always a good idea to use absolute paths in my opinion.So you can execute a script independantly in which directory your user currently is. @DeanReid: I guess the root user in your screen was just an example? ;) Nice, Thank you! :) Link to comment Share on other sites More sharing options...
jahangir13 Posted May 25, 2014 Report Share Posted May 25, 2014 What sets $STOP to '1' or greater here? And I would put a little wait into the while loop...otherwise you check and check and check as fast as possible which is not needed I guess. Link to comment Share on other sites More sharing options...
jahangir13 Posted May 25, 2014 Report Share Posted May 25, 2014 cron: * * * * * /path/to/check_server_running.sh check_server_running.sh: somethine like: if [ ps aux | grep epoch == 0 ] ./restarter.pl fi (pseudo code only). Cron will check each minute if the process is still running. If not execute restarter,pl. Link to comment Share on other sites More sharing options...
jahangir13 Posted May 25, 2014 Report Share Posted May 25, 2014 Yes, depends on what you want and how you normally do it where you are used to and know how ;) But why not...I will have a look if I get some time. I guess it's this one here? http://callofduty.filefront.com/file/CodControl;86896 Link to comment Share on other sites More sharing options...
Basti890 Posted April 7, 2015 Report Share Posted April 7, 2015 I tried to set the path in restarter.pl to an absolute path, but it keeps still saying "Can't found server binary!" If I run it via "./restarter.pl" in console. I set up a cron Job, but I coundl't chek it for now if its working. any hints where this problem can be solved ? If i start my serevr with "./epoch.sh" it runs fine. So whats the difference between epoch.sh and restarter.pl ? Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now