cron entry error


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting cron entry error
# 1  
Old 10-25-2006
cron entry error

I am using the following cron entry to run a cron job every 4 hours and
it is rejecting it:

0 */4 * * * /home/location/scriptname

When I put this entry in cron is errors with: 0481-079 reached a symbol that is not expected.

This is an AIX 5.3 system

Any ideas?

Thanks
# 2  
Old 10-25-2006
Hey, you only need to post the question once. Either it'll get answered or it won't but posting it more than once won't help and will just indicate you don't know where to post your question.

Carl
# 3  
Old 10-25-2006
sorry

I thought this was a better forum after I posted it on the other. I figured different users in this then the other.
sorry
# 4  
Old 10-26-2006
The syntax of the second field is invalid : */4
You must indicate the hours explicitly
Code:
0 0,4,8,12,16,20 * * * /home/location/scriptname

From crontab man page
Quote:
The crontab File Entry Format

A crontab file contains entries for each cron job. Entries are separated by
newline characters. Each crontab file entry contains six fields separated by
spaces or tabs in the following form:

minute hour day_of_month month weekday command

These fields accept the following values:

minute 0 through 59

hour 0 through 23

day_of_month 1 through 31

month 1 through 12

weekday 0 through 6 for Sunday through Saturday

command a shell command

You must specify a value for each field. Except for the command field, these
fields can contain the following:

o A number in the specified range. To run a command in May, specify 5 in the
month field.
o Two numbers separated by a dash to indicate an inclusive range. To run a
cron job on Tuesday through Friday, place 2-5 in the weekday field.
o A list of numbers separated by commas. To run a command on the first and
last day of January, you would specify 1,31 in the day_of_month field.
o An * (asterisk), meaning all allowed values. To run a job every hour,
specify an asterisk in the hour field.

Note: Any character preceeded by a backslash (including the %) causes that
character to be treated literally. The specification of days may be made by
two fields (day of the month and day of the week). If you specify both as a
list of elements, both are adhered to. For example, the following entry:
0 0 1,15 * 1 command

would run command on the first and fifteenth days of each month, as well as
every Monday. To specify days by only one field, the other field should
contain an * .
Jean-Pierre.
# 5  
Old 10-26-2006
and you can check the log file for the same ( if any errors)
Code:
/var/cron/log/

# 6  
Old 10-26-2006
I have also read somewhere that */4 works in cron, but in solaris it never worked for me... don't use this method.
# 7  
Old 10-26-2006
Yea, it works in Linux but not in Solaris, AIX or any of the "real" Smilie Unices. While I've been mucking around with Linux since 1994 or so (Slackware), I was a production Solaris admin before I worked on production Linux boxes.

Quote:
Step values can be used in conjunction with ranges. Fol-
lowing a range with ``/<number>'' specifies skips of the
number's value through the range. For example, ``0-23/2''
can be used in the hours field to specify command execu-
tion every other hour (the alternative in the V7 standard
is ``0,2,4,6,8,10,12,14,16,18,20,22''). Steps are also
permitted after an asterisk, so if you want to say ``every
two hours'', just use ``*/2''.
Carl
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Solaris

Cron entry

Hi I have a system running solaris 11, in which I am able to execute a script from the command line, but once I put i the crontab does run, but do not give results. The entry is: 15 11 * * * /var/oswbb/./startOSWbb.sh >> myjob.log 2>&1 30 11 * * * /var/oswbb/./stopOSWbb.sh I have check... (2 Replies)
Discussion started by: fretagi
2 Replies

2. Shell Programming and Scripting

Cron JOb Entry

Hi All, i have a folder in a server say xxx.xx.xx.xx\abcd\efgh. i want to make a cron job entry so that i would get a mail (me@example.com) on business days. will this help me... 30 4 * * 1-5 cd \abcd\efgh|ls-ltr|mailx:me@example.comhttps://www.unix.com/images/editor/code.png (10 Replies)
Discussion started by: mahesh300182
10 Replies

3. Solaris

cron entry

Hi, I have to add two cron entry now. Please correct me if anything wrong Below script should run at every one and half hour. 30 01 * * * /export/home/gxadm/scripts/collect_mq_info.pl $HOME/GCSS/logs > /dev/null 2>&1 Below script should run at every 2 hours 0 02 * * *... (9 Replies)
Discussion started by: Mani_apr08
9 Replies

4. UNIX for Advanced & Expert Users

cron entry

Hi, I need some clarification on cron entries. I have a cron job like.. 15 01 19 02 6 exec /usr/bin/test.ksh and I have another cron entry added, which is 15 01 20 02 6 exec /usr/bin/test.ksh So, I am thinking the second cron entry shouldn't have run because 02/20 is Sunday, but... (1 Reply)
Discussion started by: everurs789
1 Replies

5. UNIX for Dummies Questions & Answers

cron entry

Can someone please quickly respond to this? I need to have a script test.sh to run every 30 minutes from Monday to Saturday from 6am to 10pm as a crontab entry... Thanks. (3 Replies)
Discussion started by: everurs789
3 Replies

6. Solaris

User entry in both cron.allow and cron.deny

Hello All, Anybody please help me to know ,what happens when a user having entry in both cron.allow and cron.deny files.Wheather the user will be able to access the crontab??? Thanks in advance Vaisakh (5 Replies)
Discussion started by: ksvaisakh
5 Replies

7. Shell Programming and Scripting

not able to locate the cron entry

Hi, I am new to unix. I have once made an entry into cron file for one scirpt to run. The script sends me email. But i want the script entry removed from the cron file. But i am not able to find the entry in cron file. When i do crontab -e it shows content of the file but my script is... (3 Replies)
Discussion started by: ajincoep
3 Replies

8. Shell Programming and Scripting

Cron Entry

Hi folks, I have got the following cron entry ... 08 30 * * * /mp1/scripts/test.sh > /mp1/scripts/test_logs.txt 2>&1 The problem is that instead of generating a new test_logs.txt file every time it keeps on appending the outputs to the test_logs.txt file. What is it that I am doing wrong... (2 Replies)
Discussion started by: King Nothing
2 Replies

9. UNIX for Dummies Questions & Answers

cron entry

Hi, Where can we find Cron job logs?i have a cron job which is not executing at all, 00 12 * * * /xx/yy/job > /pp/qq/log if i execute the job alone,it is executing fine. >/xx/yy/job > /pp/qq/log (is executing fine) but its not executing when it triggered from cron.is there any place cron... (7 Replies)
Discussion started by: rujus
7 Replies

10. AIX

Cron entry

Hi All, I want to run a cron job to run on the first saturday of each month at 1:30am. Would the following entry suffice this condition 30 1 6 * 6 wall %Will this work% Appreciate your time. (1 Reply)
Discussion started by: rramanuj
1 Replies
Login or Register to Ask a Question