Problem w/ cron

Problem w/ cron

Post by Scott R. Turn » Fri, 07 Aug 1992 05:40:44



[Machine: Sun 4/110 running SunOS 4.1]

I'm trying to run nnadmin (the program to administer the NN
newsreader) from cron in order to expire articles in the middle of the
night.  The command for doing this is:

        /usr/local/bin/nnadmin =EYW

I've added this to the crontab for <news>.  Here's what the crontab
looks like:


        01 02 * * * /usr/local/bin/nnadmin =EYW

The first line truncates the log file for nnadmin.

However, cron fails when it tries to execute these commands.  I turned
on logging of cron messages, and here's what shows up in syslog:


Aug  5  sun-diego cron: >  news 13381 c Wed Aug  5 02:00:01 1992
Aug  5  sun-diego cron: <  news 13381 c Wed Aug  5 02:00:01 1992 Exit status 1
Aug  5  sun-diego cron: >  CMD: 13388 c /usr/local/bin/nnadmin =EYW
Aug  5  sun-diego cron: >  news 13388 c Wed Aug  5 02:01:00 1992
Aug  5  sun-diego cron: <  news 13388 c Wed Aug  5 02:01:00 1992 Exit status 1

(I've deleted the time field to make it fit on one line.)  Apparently
cron is having trouble running nnadmin.  Any ideas why?

        * /usr/local/bin/nnadmin exists and is rx by everyone.
        * su to "news" followed by giving the command manually works.
        * <news> does not have a home directory (is this a problem?).

Any help will be appreciated.

                                                -- Scott T.

 
 
 

Problem w/ cron

Post by Elmar Schue » Fri, 07 Aug 1992 15:13:26



>I've added this to the crontab for <news>.  Here's what the crontab
>looks like:


>    01 02 * * * /usr/local/bin/nnadmin =EYW

I did not find it in the man pages but as far as I know the command has to be
in *one* line (you did it at last) and *no* parameters are allowed.


The work around would be a one line shell script starting nnadmin w/ parameters.
Don't forget to supply the full path both in the script and in the crontab.

Hope this helps.

Regards, Elmar
--
      /\
     \\ \         Elmar Schuetz
    \ \\ /      Sun Microsystems GmbH
   / \/ / /       System Services -- Product Support
  / /   \//\      - Technical Information Services -
  \//\   / /    Bretonischer Ring 3
   / / /\ /     D-8011 Grasbrunn (Munich/Germany)
    / \\ \        phone: +49-89-46008/321 (dispatch)  fax: /320

      \/

 
 
 

Problem w/ cron

Post by Scott R. Turn » Sat, 08 Aug 1992 00:52:16


I discovered the problem with cron.

It seems that cron requires users to have a home directory.  I was
trying to run a command by userid <news>, and <news> didn't have a
home directory.  It isn't clear to me why cron should require a home
directory, but there you have it.

                                        -- Scott T.

 
 
 

Problem w/ cron

Post by Scott R. Turn » Sat, 08 Aug 1992 00:47:24



>I did not find it in the man pages but as far as I know the command
> has to be in *one* line (you did it at last) and *no* parameters are
> allowed.

I don't think that can be correct.  Certainly the crontab supplied by
Sun for <root> has paramterized commands.

                                                -- Scott T.

 
 
 

1. cron.deny and cron.allow files for CRON management

Hi All

I  can not  seem to be able to  make these files  work. Despite  an
entry  in  cron.deny  file,  the  specific user  can use
the crontab  command  to  submit  a  job  to  cron and  the  job
does  gets  executed.
Crontab  command  is  supposed  to check  entries  in these  files.
Ido not think  this is  happening.

Any  idea  will  be  greatly  appreciated.
Please  send  me an e-mail.

Thanks


2. Accessing a user's home folder.

3. Cron Problems - Script runs from shell but not cron

4. Save money!!!

5. cron and visual cron

6. Windows 95 File Systems

7. cron, perl, and signals -- cron spins out of control

8. Servers

9. Why doesn't cron run the lp cron file?

10. Help! Cron and Samba / Cron and missing directories?

11. Cron <root@host> run-parts /etc/cron.daily

12. cron listed as /USR/BIN/CRON ???

13. cron.deny and cron.allow ?