[NTLUG:Discuss] OT: crontab arguments question

Fred James fredjame at fredjame.cnc.net
Fri Feb 22 19:25:37 CST 2008


Stuart Johnston wrote:

>Fred James wrote:
>  
>
>>Stuart Johnston wrote:
>>
>>    
>>
>>>Fred James wrote:
>>> 
>>>
>>>      
>>>
>>>>Stuart Johnston wrote:
>>>>
>>>>   
>>>>
>>>>        
>>>>
>>>>>Why don't you put this in the oracle user's crontab?
>>>>>
>>>>>Or quote the -c arg:
>>>>>
>>>>>su - oracle -c '/apps/oracle/ppdb_scripts/SidTest/willi.sh ppdb'
>>>>>
>>>>>Fred James wrote:
>>>>>
>>>>>
>>>>>     
>>>>>
>>>>>          
>>>>>
>>>>>>All
>>>>>>OT: crontab arguments question
>>>>>>I need to pass an argument to my program from the crontab entry
>>>>>>Problem: the first argument is taken by an environmental script
>>>>>>Question: how do I provide for this?
>>>>>>
>>>>>>Example:
>>>>>>55 13 * * * su - oracle -c /apps/oracle/ppdb_scripts/SidTest/willi.sh ppdb
>>>>>>  the su - oracle -c is required to set certain environmental variable 
>>>>>>or nothing works
>>>>>>  the ppdb is the SID the the su - oracle eats up on the way through, 
>>>>>>and I need to send another ppdb to my program
>>>>>>
>>>>>>something like ...
>>>>>>55 13 * * * su - oracle -c /apps/oracle/ppdb_scripts/SidTest/willi.sh 
>>>>>>ppdb ppdb
>>>>>>... except that doesn't work ...
>>>>>>
>>>>>>Thank you in advance for any help you may be able to offer
>>>>>>Regards
>>>>>>Fred James
>>>>>>
>>>>>>  
>>>>>>
>>>>>>       
>>>>>>
>>>>>>            
>>>>>>
>>>>Stuart Johnson
>>>>Perhaps there is something goofy going on, but this is in the Oracle 
>>>>crontab (SGI 6.4)
>>>>   
>>>>
>>>>        
>>>>
>>>Add the environment variables that you need into the top of your crontab.
>>> 
>>>
>>>      
>>>
>>Stuart Johnston
>>I am not familiar with that - could you point me to documentation, please?
>>    
>>
>
>man 5 crontab
>
>  
>
>>       An  active line in a crontab will be either an environ-
>>       ment setting or a cron command.  An environment setting
>>       is of the form,
>>
>>           name = value
>>
>>       where   the   spaces  around  the  equal-sign  (=)  are
>>       optional, and  any  subsequent  non-leading  spaces  in
>>       value  will be part of the value assigned to name.  The
>>       value string may be placed in quotes (single or double,
>>       but matching) to preserve leading or trailing blanks.
>>    
>>
Stuart Johnson
That sounds very interesting.  I did find crontab(5) on my Linux boxes, 
but not on even the newest SGI IRIX (6.5.30) - oh, well, I guess I am 
off to find another way around the wall.

We are hoping to move to Sun Spark Solaris 10 soon, so I shall send an 
email off to see if crontab(5) is included there.
Regards
Fred James



More information about the Discuss mailing list