arkmanager / ark-server-tools

Set of server tools used to manage ARK: Survival Evolved servers on Linux
MIT License
684 stars 144 forks source link

Cronjob not working #1032

Closed PapaBaer81 closed 5 years ago

PapaBaer81 commented 5 years ago

Hello everybody. I have a little problem with my Linux server. This runs with Ubuntu 18.04.

I have specified the following in a cron job:

29 23 /usr/local/bin/arkmanager broadcast "Ein Backup wird durchgeführt. Dadurch kann zu es zu Lags kommen." 30 23 /usr/local/bin/arkmanager backup 15 5 /usr/local/bin/arkmanager broadcast "Neustart in 15 Minuten" 20 5 /usr/local/bin/arkmanager broadcast "Neustart in 10 Minuten" 25 5 /usr/local/bin/arkmanager broadcast "Neustart in 5 Minuten" 29 5 /usr/local/bin/arkmanager broadcast "Neustart in 1 Minute" 30 5 /usr/local/bin/arkmanager restart 0 * /usr/local/bin/arkmanager --cronjob --hourly update @all --saveworld --warn --update-mods -- >/dev/null 2>&1

None of the broadcast jobs will be executed. Also the restart is not carried out. But if I enter the command myself in the console, the message will be sent. Does one perhaps have a solution?

Sorry for my bad english

klightspeed commented 5 years ago

Firstly, the instance names (including @all) are case-sensitive.

Second, if the instance name is not specified, then the command will run against the default instance if configured, and otherwise ask which instance to run the command against. When running from a cronjob, this will cause the command not to run if no default instance is configured.

Third, --hourly is not recognized as a global option, so will be treated as an unknown command.

PapaBaer81 commented 5 years ago

Hi, the defaultinstance is specified in arkmanager.cfg. The "Main.cfg" is renamed in main.cfg.bak

it looks like the last cronjob works but the broadcast and the restart are not working

here an abstract of the cron log Aug 9 17:00:01 h2797914 CRON[27133]: (root) CMD (/usr/local/bin/arkmanager --cr onjob --hourly update @all --saveworld --warn --update-mods -- >/dev/null 2>&1)

PapaBaer81 commented 5 years ago

also the backup at 23:30 works. only there are no broadcasts sent before

klightspeed commented 5 years ago

Is RCON enabled? The broadcast command uses rcon.

klightspeed commented 5 years ago

The output of cron jobs are usually emailed. When no email is configured, they'll go into a dead.letter file in the home directory of the user under which the command is running. Please check the dead.letter file in /root.

PapaBaer81 commented 5 years ago

RCON is enabled. I can send messages in Chat, Broadcast and PM via ARKon. In /Root is no dead.letter

klightspeed commented 5 years ago

Does it work if you put it into the crontab of the user rather than root's crontab?

PapaBaer81 commented 5 years ago

that worked right now. thank you. I don't know why i have to use crontab of the user rather than root. On my old Server it worked just fine with root

klightspeed commented 5 years ago

If you have selinux enabled, or some other extended security, then running the script via runuser from the root crontab context might prevent the script from communicating with or interacting with the server.