LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   crontab not running script (https://www.linuxquestions.org/questions/linux-software-2/crontab-not-running-script-4175553124/)

coralfang 09-10-2015 09:52 AM

crontab not running script
 
Hi, i have archlinux on a raspberry pi here. Mainly used for a small game server. I have a user added to run the server, and placed the following in in crontab.

Code:

* * * * * /home/redeclipse/start_server.sh
AFAIK this should execute the script every minute.

The script in question is (which is executable):
Code:

#!/bin/sh
/usr/bin/pgrep redeclipse > /dev/null
if [ $? -ne 0 ]
then
        cd $HOME/redeclipse/bin/arm
        REDECLIPSE_PATH=$HOME/redeclipse/
        REDECLIPSE_HOME=$HOME/.redeclipse/
        #REDECLIPSE_OPTIONS="-g/home/redeclipse/redeclipse.log"

        ./redeclipse_server_linux > $HOME/redeclipse/redeclipse.log &
fi

This works when i "su - redeclipse" and run the script manually, starting the server.

Basically it checks if the program is already running (sometimes the server can crash) in the hope to keep it online, however, when the server does crash, it is never restarted.

Can anyone point out what is wrong?

I have been told that crontab should run even when the user is logged out. I have the user "redeclipse" as a system account within group nobody.

Ie; /etc/passwd entry
Code:

redeclipse:x:220:99::/home/redeclipse:/bin/bash

coralfang 09-10-2015 10:10 AM

Ah nevermind, i hadn't enabled the "cronie" service. It is working now.


All times are GMT -5. The time now is 09:54 PM.