The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.
|
 |
|
Dev Shed Forums
> Operating Systems
> Linux Help
|
I thought I knew Cron.....
Discuss I thought I knew Cron..... in the Linux Help forum on Dev Shed. I thought I knew Cron..... Linux Help forum discussing topics including usage, troubleshooting, modules, and distributions. Linux is an open source OS, based on UNIX.
|
|
 |
|
|
|
|

Dev Shed Forums Sponsor:
|
|
|

December 9th, 2010, 03:30 AM
|
 |
Square Peg in a Round Hole
|
|
Join Date: Oct 2007
Location: North Yorkshire, UK
|
|
|
I thought I knew Cron.....
....But then I saw this syntax:
Code:
*/10 * * * * cmd/to/run
can anyone tell me what the */10 means in the minutes column?
More importantly, I'm trying to stop it attempting to send emails. at the moment I have
Code:
path/to/php path/to/script/to/run > path/to/log/file
BUt after my server updated it's version of plesk I'm now getting emails, can i do
Code:
path/to/php path/to/script/to/run > path/to/log/file > /dev/null 2>&1
to prevent emails?
|

December 9th, 2010, 07:55 AM
|
|
|
|
I believe the */10 means every 10 minutes - at HH:10, HH:20, HH:30, etc.
If your script produces emails then redirecting output is not going to prevent the mails from being pushed out by the mailer program being used - even if you could do what you are trying (the double redirection).
If you don't want mails beign sent then just comment out (or remove) that entry from your crontab. Problem with that, of course, is if you want other things the script does. In that case you'll need to find the 'payload' within the script and comment that part out.
__________________
The moon on the one hand, the dawn on the other:
The moon is my sister, the dawn is my brother.
The moon on my left and the dawn on my right.
My brother, good morning: my sister, good night.
-- Hilaire Belloc
|

December 9th, 2010, 05:09 PM
|
|
|
from man 5 crontab
Quote: Step values can be used in conjunction with ranges. Following 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 execution 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". |
__________________
======
Doug G
======
It is a truism of American politics that no man who can win an election deserves to. --Trevanian, from the novel Shibumi
|
Developer Shed Advertisers and Affiliates
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Rate This Thread |
Linear Mode
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|