[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference turris::digital_unix

Title:DIGITAL UNIX(FORMERLY KNOWN AS DEC OSF/1)
Notice:Welcome to the Digital UNIX Conference
Moderator:SMURF::DENHAM
Created:Thu Mar 16 1995
Last Modified:Fri Jun 06 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:10068
Total number of notes:35879

6990.0. "Commands in crontab not working!" by ADOV01::SHARPE (Darwin's Dangerous Idea) Tue Sep 10 1996 08:04

T.RTitleUserPersonal
Name
DateLines
6990.1Solution foundADOV01::SHARPEDarwin's Dangerous IdeaTue Sep 10 1996 21:059
6990.2SANITY::LEMONSAnd we thank you for your support.Thu Mar 13 1997 09:167
    Hi
    
    I want to run a crontab job that uses, say, csh or ksh commands.  How
    do I tell crontab which shell to use?
    
    Thanks!
    tl
6990.3BIGUN::nessus.cao.dec.com::MayneChurchill's black dogThu Mar 13 1997 16:183
Create a script that uses the correct shell, and call the script?

PJDM
6990.4SANITY::LEMONSAnd we thank you for your support.Thu Mar 13 1997 18:329
    I know, I know, stupid question, but not for someone trying to break
    into this world.  A quick glance at the manual and man page didn't help
    me.  I'm assuming that crontab would run a sh, csh or ksh script.  Will
    it just figure out which shell is appropriate, and use the right one
    when it runs the job?  Or do I put something into my script that tells
    which shell to use?
    
    Thanks!
    tl
6990.5Yup.QUARRY::reevesJon Reeves, UNIX compiler groupThu Mar 13 1997 18:556
If the first line in your shell script is

#!/bin/csh

the script will be run by csh.  Similarly for the others (or in fact,
any arbitrary command like awk or perl).
6990.6HELIX::SONTAKKEFri Mar 14 1997 09:136
    Is there a way to use crontab by mere mortals?  What's the equivalent
    way to do it by non-root users?
    
    kamlia 6% crontab -l c
    crontab: you are not authorized to use cron.  Sorry.
    
6990.7DECWET::MARTINFri Mar 14 1997 16:329
From the man page on crontab(1), in v4.0,

  [XPG4-UNIX]  You can use the crontab command if your username appears in
  the /usr/lib/cron/cron.allow file.  If that file does not exist, the cron-
  tab command checks the /usr/lib/cron/cron.deny file to determine if you
  should be denied access to crontab.  The allow/deny files contain one user-
  name per line.  If neither file exists, you can submit a job only if you
  are operating with superuser authority.

6990.8But why ??HELIX::SONTAKKEMon Mar 17 1997 11:319
    So, I guess that unless blessed by the God, batch jobs are off limits
    to mere mortal in Digital UNIX?
    
    If I were to write my own stupid program to sleep() and system(),  then
    there is nothing in the system to deny me that, correct?
    
    So why the brain-dead .allow and .deny business ?
    
    - Vikas
6990.9IOSG::MARSHALLMon Mar 24 1997 12:4516
>> batch jobs are off limits

No; see batch(1).  You just can't specify a particular time (for that you need
at(1), which again uses .allow/.deny).

>> why the brain-dead .allow and .deny business ?

For cron(8), I guess it's 'cos cron is meant for system-y type things rather
than user things.  For at(1) I guess it's so the system manager can, err, manage
the system...

>> my own stupid program to sleep() and system()

How about just: $ (sleep n; command) &

Scott