Notifications
Clear all

-*/15 on cron job

9 Posts
3 Users
0 Reactions
1,908 Views
 ding
(@ding)
Eminent Member
Joined: 17 years ago
Posts: 22
Topic starter  

What does it mean?
I know */15 at the first column on the crontab file is for "every 15 minute", but I don't know what '-' is for. I know it is for range, but I don't know what that is in this case.


   
Quote
(@kovar)
Prominent Member
Joined: 18 years ago
Posts: 805
 

Greetings,

What OS are you looking at? That doesn't look legal to me.

_David


   
ReplyQuote
(@lynch719)
Active Member
Joined: 17 years ago
Posts: 8
 

Show the entire line from the crontab file.
The "-" is for range but you dont say which column or give any context. ?


   
ReplyQuote
 ding
(@ding)
Eminent Member
Joined: 17 years ago
Posts: 22
Topic starter  

Here it is. It is from Ubuntu 8.10 default installation.

$ more /etc/crontab
-*/15 * * * * root test -x /usr/lib/cron/run-crons && /usr/lib/cron/run-crons >/dev/null 2>&1


   
ReplyQuote
(@kovar)
Prominent Member
Joined: 18 years ago
Posts: 805
 

Greetings,

You have the output redirected to /dev/null. Could you redirect that to somewhere you can find it and check the results? Also, look at your log file for cron, it may well be throwing an error on that line.

I'd fire up an Ubuntu instance. create a dummy cron job, and find out how often it fires, if it fires at all, with that syntax.

-David


   
ReplyQuote
(@lynch719)
Active Member
Joined: 17 years ago
Posts: 8
 

I have not seen that "-" used liked that in a crontab. I thought it may be an artifact from a gui text editor but you used the cli utility more to copy/paste the line for us.


   
ReplyQuote
 ding
(@ding)
Eminent Member
Joined: 17 years ago
Posts: 22
Topic starter  

The following is from OpenSuSE. I think it is a setting from default installation.

$ more /etc/crontab
SHELL=/bin/sh
PATH=/usr/bin/usr/sbin/sbin/bin/usr/lib/news/bin
MAILTO=root
#
# check scripts in cron.hourly, cron.daily, cron.weekly, and cron.monthly
#
-*/15 * * * * root test -x /usr/lib/cron/run-crons && /usr/lib/cron/run-crons >/dev/null 2>&1


   
ReplyQuote
(@lynch719)
Active Member
Joined: 17 years ago
Posts: 8
 

From my Opensuse 11 system, I tried the command you posted$ more /etc/crontaband got the same output as you, along with a dash -*/15 * * * * root test -x /usr/lib/cron/run-crons && /usr/lib/cron/run-crons >/dev/null 2>&1 I am going to see if anybody I know can answer this.
will post back.


   
ReplyQuote
(@lynch719)
Active Member
Joined: 17 years ago
Posts: 8
 

This link explains it I thinkderkeiler.com

cron logs via syslog; there should be log records about the start of each
job in /var/log/messages. The exception is when your crontab line starts
with "-" (a hyphen), then job start logging is turned off.

HTH
lynch719


   
ReplyQuote
Share: