Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to change the shell of cron

Status
Not open for further replies.

cantubas

Programmer
Jan 8, 2004
45
FR
when i do "at now prog" i have the fallowing warning:
warning: commands will be executed using /usr/bin/sh


i have this warning because users have /usr/bin/ksh as default shell and it was different.

do you know how to modify the default shell of cron.

thanks

 
I was having a simular problem with crons default being sh and wanting to be in csh. I found some where that you should be able to put a line such as SHELL = in your cron tab file but on my system, Solaris 9, this was not allowed. So the best I have found to do is to have the following as the 1st line in the script file cron calls

#!/usr/bin/csh

If it is just one command I want cron to do I do the following:

csh command

thus the command is executed in the csh shell.

Hope this helps.
 
?? how to change the shell of cron ??

no idea, this is a very misterious setting,
even if you change the root login shell (in /etc/passwd,
was current in bsd-sunos) cron tries /bin/sh, mybe this
is hardcoded.

kymlyons suggestion is correct, this way you never
get problem.
an other possibility is use env in crontab:

?? ?? ?? ?? ?? env SHELL=/bin/?sh <your-cmds> <and-args>

************** for AT only:

at -c ??????? will force a /bin/csh
at -k /bin/ksh
at -s /bin/sh


:) guggach
 
ATTENTION !!!
IF /etc/cron.d/[at|cron].allow IS PRESENT
=========================================
dont forget to include 'root' in it!!!

:) guggach
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top