Script won't run from CRON

From: maddman (maddman_75_at_yahoo.com)
Date: 05/26/04


Date: 26 May 2004 10:25:12 -0700

Hello all. Let me describe my setup. I have a mandrake 9.1 server
for our information kiosks. There are six terminals in the plant, run
using LTSP. Mozilla provides the content to the users.

We've had a problem with users closing mozilla and not knowing how to
get it back open, either because clicking an icon is too much for
them, or some wanna-be hacker has deleted the icon. (Coincidentally,
if anyone would know a way for me to 'lock' the taskbar/panel in KDE
I'd be eternally grateful)

Anyway, my solution is to run a shell script to see if mozilla is
running on that user (one username per station) and if not, to start
it. Here's said shell script.

if [ -z "`ps --User username001 | grep "mozilla.bin"`" ]
then
`/usr/bin/mozilla`
fi

Works from the command line just fine. So I bring up a console and do
"crontab -e" to add it to this user's cron. However, it doesn't seem
to be working correctly. It doesn't do anything. Checking in
/var/log/messages it is getting ran as the same user, but it isn't
opening mozilla. Oh, here's what I get from 'crontab -l'

* * * * * /home/username001/mozcheck

I want it running every minute, and have the script in the user's home
directory. Now I could put the script in a central place and read the
username into the command line, but I'm not certian about how to enter
this into the crontab. I have it like this until I get the script
working correctly.

Thanks in advance for any tips!

maddman



Relevant Pages

  • Re: GPG in crontab causes blank messages
    ... When I run my crontab command manually in terminal, ... But since the output of the script contains a big list of files, ... If I remove the GPG portion of the command, ...
    (comp.sys.mac.apps)
  • SUMMARY: cron entry: nth day of every month?
    ... cron can not handle this with its own syntax. ... 21st but "command" only runs if the output of the "date" command ... What I would suggest is rather than embedding the logic in each script ... The answer is it is _not_ possible to control it only with crontab ...
    (Tru64-UNIX-Managers)
  • Re: crontab issue
    ... your environment ... ... Simon is absolutely right about the script ... ... crontab file ugly, just because you can? ... solved by making the command a separate script. ...
    (AIX-L)
  • Re: crontab issue
    ... But if it works fine from a script, ... questions about crontab problems on this list, most of which could easily be ... solved by making the command a separate script. ... > and the command would not execute. ...
    (AIX-L)
  • Re: crontab related .. again
    ... >>> The above command works fine with the following ... >>> This latter script work in command line. ... > Yes crontab allow */1 specificatin. ... > How to know the cron's working directory how to make the current ...
    (comp.unix.shell)