The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
I want to know how we can give alias entry in cron naree SUN Solaris 1 03-12-2008 09:46 AM
cron entry rujus UNIX for Dummies Questions & Answers 7 01-29-2007 05:36 PM
cron entry issue --- help required Jamesravid Shell Programming and Scripting 1 02-02-2006 03:30 AM
Cron job entry not running hkapil Shell Programming and Scripting 1 11-21-2005 10:46 AM
Cron entry rramanuj AIX 1 11-01-2005 02:35 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 10-25-2006
capeme capeme is offline
Registered User
  
 

Join Date: Oct 2006
Posts: 25
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 (permalink)  
Old 10-25-2006
BOFH BOFH is offline Forum Advisor  
Registered User
  
 

Join Date: Feb 2005
Location: Broomfield, CO
Posts: 406
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 (permalink)  
Old 10-25-2006
capeme capeme is offline
Registered User
  
 

Join Date: Oct 2006
Posts: 25
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 (permalink)  
Old 10-26-2006
aigles's Avatar
aigles aigles is offline Forum Advisor  
Registered User
  
 

Join Date: Apr 2004
Location: Bordeaux, France
Posts: 1,416
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 (permalink)  
Old 10-26-2006
srikanthus2002's Avatar
srikanthus2002 srikanthus2002 is offline
Registered User
  
 

Join Date: Sep 2006
Location: Can u guess...!
Posts: 160
and you can check the log file for the same ( if any errors)
Code:
/var/cron/log/
  #6 (permalink)  
Old 10-26-2006
mahendramahendr mahendramahendr is offline Forum Advisor  
Registered User
  
 

Join Date: Dec 2005
Location: London
Posts: 222
I have also read somewhere that */4 works in cron, but in solaris it never worked for me... don't use this method.
Closed Thread

Bookmarks

Tags
linux

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 10:01 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0