LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 09-10-2015, 09:52 AM   #1
coralfang
Member
 
Registered: Nov 2010
Location: Bristol, UK
Distribution: Slackware, FreeBSD
Posts: 836
Blog Entries: 3

Rep: Reputation: 297Reputation: 297Reputation: 297
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

Last edited by coralfang; 09-10-2015 at 09:54 AM.
 
Old 09-10-2015, 10:10 AM   #2
coralfang
Member
 
Registered: Nov 2010
Location: Bristol, UK
Distribution: Slackware, FreeBSD
Posts: 836

Original Poster
Blog Entries: 3

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


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Script is not running in Crontab Deepesh_tr Linux - Newbie 8 09-02-2012 07:43 PM
Crontab not running script j8177e5 Linux - Newbie 2 12-21-2010 08:54 AM
[SOLVED] Crontab Script Not Running th1bill Ubuntu 4 12-10-2010 03:49 PM
crontab not running script sunlinux Linux - Newbie 5 05-18-2010 06:21 AM
Running a script with crontab. glore2002 Slackware 3 06-05-2008 08:48 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 04:42 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration