default cron shell


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting default cron shell
# 1  
Old 10-13-2008
default cron shell

hi,

when i finish editing my cron, a messagge appears "commands will be executed using /usr/bin/sh"

Can I change this default?

I want to run my cron jobs using /usr/bin/ksh.

I know that i can do it putting one more line within scripts
#!/usr/bin/ksh

but, i want to cron one line commands sometimes.

thanks
# 2  
Old 10-13-2008
One way.
Code:
 echo "< my one line commands goes here >" | /bin/ksh

# 3  
Old 10-13-2008
Code:
* * * * * /bin/ksh a_script_name.sh

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Need help with Shell Scripting and cron

Hi everyone, I'm doing a small project for my scripting class using cron and I've come to a point where I can't get the last echo command to work at all. I would like it to create a file in the /watcher folder with the given information and also, just to clarify, print the same time and date from... (3 Replies)
Discussion started by: millanboy
3 Replies

2. Shell Programming and Scripting

[Solved] Shell not running through cron

Hi freinds, I have tried running a script through cron ,it is a shell script which calls a oracle procedure , problem here is that there is function in sql code which makes a external C call , this function is failing when running manually but works when run manually. I have trouble shooted... (6 Replies)
Discussion started by: Jcpratap
6 Replies

3. Shell Programming and Scripting

Bash Shell Script and Cron

How can I tell a script to only execute if the other scripts exits successfully? So "script A" executes and if it executes successfully (0),then "script B" will run or else "script A "executes and it exits unsucessfully (1) then "script B" will read return code (1) and will not execute ... (3 Replies)
Discussion started by: metallica1973
3 Replies

4. Shell Programming and Scripting

cron vs shell scripting

hi... im quite new in unix been using it for 2 years i got a job to monitor error/failure my question is which is better to do a routine job crond / shell script the idea is to put all the command and make it append all the output to a txt/log file tq in advance (3 Replies)
Discussion started by: zenous
3 Replies

5. Shell Programming and Scripting

Shell script and Cron

Hi there, I have a script that pulls in a weather feed via FTP then writes the output to a file. This script is run everyday at 3pm by cron. Heres the shell script: #!/bin/sh HOST='ftp.weatheronline.co.uk' USER='my username' PASSWD='my password'... (2 Replies)
Discussion started by: mpk_3
2 Replies

6. Shell Programming and Scripting

Shell script not working in cron

Hello, I know little about shell scripting and creating a script, and worked fine in the command line. But not work in the cron. Below you could see the script #!/bin/sh LOGFILE=/home/transfield/mou/test.log # Find yesterday Date and copy files TODAY=$(date --date= +%F) YESTERDAY=$(date... (4 Replies)
Discussion started by: malikp
4 Replies

7. Shell Programming and Scripting

Cron job shell script..

Hey Guys, i was trying out a shell script which has to remove a file for every 90 mins. this is the code i came up with . $ crontab -e file1 file1 contains 30 1 * * * * rm -r /folder1/folder2/somefile.txt Now i need the cron to run for every 90 mins. the problem with this is... (8 Replies)
Discussion started by: Irishboy24
8 Replies

8. Shell Programming and Scripting

which one is better Run by Cron or Shell

Dear Experts, I have a script defined in Cron which runs every 1 minute. * * * * * /export/home/myscript.sh >/dev/null 2>&1 Now the issue is executing that myscript.sh sometime will take 2/3 or more minutes to finish execution. But after 1 minute cron will invoke another... (4 Replies)
Discussion started by: thepurple
4 Replies

9. AIX

Is it possible to have more than one Cron in shell script?

Hi, can we have more than one cron in the shell script? If so pls let me know on what basis it is running. Whether on OS scheduling or the time scheduled in the cron file.Pls answer this query. Many Thanks (4 Replies)
Discussion started by: Yamini Thoppen
4 Replies

10. UNIX for Dummies Questions & Answers

Cron running shell scripts.

What are the rules of calling shell scripts in cron. How do I go about setting up the correct PATHS that calls a script, which then calls another sub script all of which has to retain the orginal PATHS and VARS that I've set up in first script Confused.. ok Well Cron calls a script... (3 Replies)
Discussion started by: cfoxwell
3 Replies
Login or Register to Ask a Question