Need help Can't seem to make Mwar to start automatically, I've done all the tutorials I've found in the forumn but can't seem to make it start automatically. I'm just able to run it manually by # war_start
Printable View
Need help Can't seem to make Mwar to start automatically, I've done all the tutorials I've found in the forumn but can't seem to make it start automatically. I'm just able to run it manually by # war_start
In the /ets/cron.d directory, create a new file or edit an existing one (any name). You need to add the following line so that the war of nations starts every 4 hours:
Or indicate the start hours:Code:0 */4 * * * root /bin/bash /usr/bin/war_start
Code:0 0,4,8,12,16,20 * * * root /bin/bash /usr/bin/war_start
in /etc/crond
crond is a file without extension, so go to folder "etc" and search "crond". It's a file that need to be edited, not a folder.
Right. Only you do not need to add a channel shutdown to the schedule - it will shut off automatically a few minutes after the end of the war (10-15 minutes, I don’t remember exactly).
UPD: It looks like you are trying to start a war every hour. Then I would advise you to make the duration of the war not 50 minutes, but 30-35 so that the channel can automatically turn off before the end of the hour. Or just use "war_restart" instead of "war_start". And do not list all hours - use 0 */1 * * *
Schedule structure in crontab:
He is doing everything right. There is no "crond" file in the etc directory, there is a "crontab". But the creation of separate schedule files, where each file has its own specialization, seems to me more acceptable than adding all schedules to crontab. And in practice, we see that everyone uses the of directory cron.d.Code:# Example of job definition:
# .---------------- minute (0 - 59)
# | .------------- hour (0 - 23)
# | | .---------- day of month (1 - 31)
# | | | .------- month (1 - 12) OR jan,feb,mar,apr ...
# | | | | .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat
# | | | | |
# * * * * * user-name command to be executed
ohh you mean this crontab? I did not see this for the past few days. I did get the war running yesterday but as you've said it can't be because theres 10 mins prep time + 50mins war +10-15 mins for the war channel to shutdown so it gets buggy sometimes the war doesn't start sometimes it does.
- - - Updated - - -
can you please give me a sample code If I want to start the war every 2 hours in crontab? there's no crond directory in etc.
- - - Updated - - -
do you I have to set the permission to 700? for the crontab to excetute the command or i can just leave it in 644?
You did the right thing at first. In the /etc/cron.d/ directory, add the line to the chk_cabal file:
You do not need to change permissions for the schedule files, leave the standard 644. You do not need the crontab file, use the /etc/cron.d/ directoryCode:0 */2 * * * root /bin/bash /usr/bin/war_start
Or do you need a team to restart the war? "war_restart" does not work in the terminal?
I have been waiting for your reply. While I was waiting I tried to add this lines in the crontab (in the ScreenShot) but it doesn't work up until now I was waiting for the war channel to start but it does't started. I rebooted Centos and cabal_restart. was I missing something like do I have to start like daemon or something like that? I'm sorry I'm not very famillar with centos yet.
- - - Updated - - -
I'll try to add "0 */2 * * * root /bin/bash /usr/bin/war_start" in chk_cabal file now.
- - - Updated - - -
can I use that code if I want to start the war specifically like 0:00, 2:00, 4:00 and so fort and not 2 hours from the time I started my server? won't it start like that? for example I rebooted my server from 4:27, won't the war start in 6:27 next?
The option I proposed executes the program every 2 hours starting from midnight (that is, even hours). For odd ones, you can try using 1-23/2. And yes, you can simply list the hours you need, separated by commas, if necessary. In the first post I gave you an example.
If the war does not start, be sure to use the correct command. Short commands you use in the terminal (for example, cabal_restart) are located in the /usr/bin/ directory. You see in the example that I add this path to the war_start command. But does this command work for you in the terminal? Look at the logs in var/log/cron
https://prnt.sc/s5zkx7
https://prnt.sc/s5zkx7
You can also run /home/cabal/*.sh files (similar to the saint channel)
And do not use crontab, write the schedule in chk_cabal
It works when I start the war channels manually using war_start and war_stop but it doesn't start automatically. do I have to wait for midnight for the war to start automatically? bacause after I have been waiting for hours and it still doesn't start automatically.
Look at the cron log, I wrote to you above. There the problem will be described. Also look at the file /var/spool/mail/root, there cron also sometimes writes errors.
Do you have any cron on?
Status:
# systemctl status crond
Autostart:
# systemctl enable crond
Start:
# systemctl start crond
Fixed it Thank you. but I have another problem in war 52-79 after Nation win I get kicked out of the channel and gets dc. in war 170-200 it doesn't.
[Warmap_Info]ChannelCloseWhenFinalStage=0
the channel close when final stage is set to 0. I wonder what's wrong? I kinda set that to 1 the other day so the channel closes after the war but I have returned it to 0 but it still gets dc.