Cron Job : unexpected symbol


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Cron Job : unexpected symbol
# 1  
Old 04-24-2009
Cron Job : unexpected symbol

Hello Experts,

I am trying to setup a crontab with 2 jobs but getting the familiar error
Code:
0481-079 Reached a symbol that is not expected

I would like to know if the below code is the only way to show a fixed interval. Don't we have something more efficient.
Code:
0	0,2,4,6,8,10,12,14,16,18,20,22	*	*	*	sh /usr/myShell.sh

This is also addressed here but not resolved.

Thank You.

Regards,
HKansal

Last edited by hkansal; 04-24-2009 at 11:24 PM..
# 2  
Old 04-25-2009
Quotes.

0 0,2,4,6,8,10,12,14,16,18,20,22 * * * "sh /usr/myShell.sh"

However, preferably, you'd just make /usr/myShell.sh executable and not call it with sh.
# 3  
Old 04-25-2009
Hello,

Kindly excuse me for putting up misleading statements.
The error was encountered while using */2 in place of 0,2,4,6,8,10,12,14,16,18,20,22.

That is what the problem is actually. It is a highly inefficient way of writing and I would like to know if we have something more efficient.

The code I used w/ sh is working absolutely fine, just the troubles with the long sequence.

Thank You.

Regards,
HKansal
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Cron job - Need to run Cron every quarter at particular time

Hi, 1) If some job supposed to run on 1st of every month at 7 AM In cron job when we have a blackout on the 1st ( i.e when 1st falls on a sunday ) how can we make the job run the next business day? 2) How can we run a job on 25th of every quarter 7 AM(jan,apr,jul,oct) And if 25th... (5 Replies)
Discussion started by: System Admin 77
5 Replies

2. UNIX for Dummies Questions & Answers

Cron Job

How to schedule a cron job to run every other Monday. Thanks in advance. (2 Replies)
Discussion started by: ITDev01
2 Replies

3. Shell Programming and Scripting

Commented cron job -- cron monitoring

Hi I have a requirement to write a shell script,that will check the all commented job in cron job.Please help !! (2 Replies)
Discussion started by: netdbaind
2 Replies

4. Shell Programming and Scripting

Unexpected EOF while looking for matching `'' when ran from a cron job

Since cPanel does not support deleting emails older then X amount of days I am using the following on a Cron Job. find -P /home/user/mail/domain/ -mindepth 2 -mtime '+366' -type f -printf '"%p"\n' | grep -v '/Important' | grep -v '/.Important' | xargs -I {} rm -r "{}" Executing it via SSH... (4 Replies)
Discussion started by: tiagom
4 Replies

5. Solaris

Cron job running even after cron is removed

Hi , I have removed a cron for particular user , but cron job seems to be running even after the cron entry is removed. The purpose of the cron was to sendmail to user ( it uses mailx utility ) I have restarted cron and sendmail service still user is getting mail alerts from the cron job. And... (4 Replies)
Discussion started by: chidori
4 Replies

6. Shell Programming and Scripting

Unexpected results when triggered from cron

Following script gives different results when triggered from Cron compared to when triggered from command line. It is not able to assign values to some variables when triggered from cron. Can any one help? Its a very simple script Script - #! /bin/ksh sFile=$1 sEnv=$2 sWaitFile=$3... (1 Reply)
Discussion started by: sumeet
1 Replies

7. HP-UX

error 1000: Unexpected symbol

Hi All, I have a code which is used for conversion from binary to ASCII. This code works absolutely fine on Linux and Solaris And the same is giving many errors and warnings on HPUX. The machine on which i am compliing is "HP-UX kautilya B.11.11 U 9000/800 876920620 unlimited-user license" ... (10 Replies)
Discussion started by: junaid.nehvi
10 Replies

8. Solaris

cron job starts new cron proccess

I run cron in solaris 10 zone. One cron job which syncing files to nfs mounted on container, creates after finishing another cron proccess(/usr/sbin/cron), and after 100 existing cron proccesses next cron job will not start. It's too weird for me, I'm not able to solve this problem. Theoretically... (3 Replies)
Discussion started by: ron76
3 Replies

9. Solaris

cron job

hi, how i woulsd be able to find that my cron job is running or not.. E.g abc (2 Replies)
Discussion started by: sam.whocares
2 Replies

10. UNIX for Dummies Questions & Answers

CRON usage for CRON job

can anybody explain the usage of CRON for adding a cron job. please provide an example also for better understanding !!! Thanks (1 Reply)
Discussion started by: skyineyes
1 Replies
Login or Register to Ask a Question