CRON JOB SCHEDULER throwing "option not allowed error"


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers CRON JOB SCHEDULER throwing "option not allowed error"
# 1  
Old 07-22-2010
CRON JOB SCHEDULER throwing "option not allowed error"

Hi All,

Pardon me if this turns out to be a dumb question. But I am trying to schedule a cron job for a my script which takes input options. So an entry in crontab would be something like:

Code:
1 * * * * run_report.sh -o out.csv -m monthly -e somename@email.com > cron_output.log 2> cron_error.log

note that after intial cron job time details the next part i.e.
Code:
run_report.sh -o out.csv -m monthly -e somename@email.com

is what my script needs inputs to run but cron complains abou options as it misunderstands it to be its own options. How do it get around this?

You help much appreciated.

Thanks,

Last edited by pludi; 07-23-2010 at 01:49 AM.. Reason: code tags, please...
# 2  
Old 07-23-2010
What Operating System do you have and which Shell (e.g. ksh, bash, Posix etc.) should be used to run the script?

Can you show us the script?
What is the absolute path to find the script?
Should the script be run as any particular user?

Where are you seeing "option not allowed" ?

Is this a root cron or one for a named user?
Are you logged in as root or a named user?
If this is a named user, does that user have permissions to use cron?
# 3  
Old 07-23-2010
Why do you not have absolute path(s) to files? ie.

Code:
/home/truharsh/run_report.sh

cron does not login to your home directory when it runs your scripts

Last edited by jim mcnamara; 07-23-2010 at 06:27 PM.. Reason: error fix
# 4  
Old 07-23-2010
why not just put
Code:
run_report.sh -o out.csv -m monthly -e somename@email.com

into another script and run that from the cron?
 
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

What is the meaning of "-s" option in "if" statement?

Hi Guys, I'm sorry but I can't find answer for this, what is the meaning of -s option in "if" statement on unix scipting. Please see sample below: opath=/home/output for i in N1 N2 N3 N4 do echo $i if then grep $i $opath/N5_CRAI > $opath/N5_$i.crai chmod 777 $opath/N5_$i.crai ... (7 Replies)
Discussion started by: rymnd_12345
7 Replies

2. Shell Programming and Scripting

sendmail script throwing an error "No recipient addresses found in header"

Hi, I am using following code to send an e-mail with attachment and body. echo "To: user1@mail.com,user2@mail.com" > mail.tmp echo "Cc: user3@mail.com,user4@mail.com" >> mail.tmp echo "From: group@mail.com" >> mail.tmp echo "Subject: my report" >> mail.tmp echo "please see as attached"... (6 Replies)
Discussion started by: vivek_damodaran
6 Replies

3. Shell Programming and Scripting

awk command to replace ";" with "|" and ""|" at diferent places in line of file

Hi, I have line in input file as below: 3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL My expected output for line in the file must be : "1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL" Can someone... (7 Replies)
Discussion started by: shis100
7 Replies

4. UNIX for Dummies Questions & Answers

Error: "logger: illegal option -- p"

Hi All, I am working on a Solaris 10 server. From this month start, it gives the error "logger: illegal option -- p" with each command. If I execute a script whose output shown on terminal, it comes many times.. Could you please help? It comes only for my login. And I dont remember any changes... (4 Replies)
Discussion started by: jaiseaugustine
4 Replies

5. AIX

ssh public key auth "Remote login for account is not allowed" ?

Hello, Using AIX 6.1 boxes. User user1 connects from box A to box B using ssh. When password authentication is used everything is fine. When I configure user1 to use public key authentication sftp client works fine(no password asked), but ssh client fails. This is sshd log: Accepted publickey... (3 Replies)
Discussion started by: vilius
3 Replies

6. Shell Programming and Scripting

"ld.so.1" error using a cron job | works fine otherwise

Hi, A cron job CJ invokes a shell script SC. SC internally invokes multiple perl scripts. One of the perl scripts deals with Accurev (i am using Accurev CLI). The first accurev command encountered is accurev merge -i <<file_name>> (file name has absolute path) When I run the perl script or... (1 Reply)
Discussion started by: singh
1 Replies

7. Shell Programming and Scripting

read -p "prompt text" foo say "read: bad option(s)" in Bourne-Shell

Hallo, i need a Prompting read in my script: read -p "Enter your command: " command But i always get this Error: -p: is not an identifier When I run these in c-shell i get this error /usr/bin/read: read: bad option(s) How can I use a Prompt in the read command? (9 Replies)
Discussion started by: wiseguy
9 Replies

8. Shell Programming and Scripting

Job scheduler without using cron

Hi, I want to schedule the scripts/batches to run simultaneously. I had all the information in the config (flat)file, which contains script name, time, dependency, path, priority and status etc., I want to run the jobs parellelly and some jobs are required to give the input. How can I do this?... (1 Reply)
Discussion started by: sharif
1 Replies

9. UNIX for Dummies Questions & Answers

Unix "at" / "Cron" Command New Problem...Need help

Hi All, I am trying to schedule a one time job using the at command with the help of shell script for my project. The shell script should take a parameter as a command line argument from the at command itself. Is it possible to take a command line parameter for a shell script in the command... (3 Replies)
Discussion started by: Mohanraj
3 Replies
Login or Register to Ask a Question