LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 01-06-2024, 07:01 AM   #1
JinxsDad
Member
 
Registered: Apr 2023
Location: Fort Walton Beach, FL
Distribution: Slackwareb15
Posts: 282

Rep: Reputation: 23
One entry in crontab gets 60 messages (one per second)


This is something I've never seen. Cron did send email this morning for my crontab entry for today ... 60 of them, to be exact. One per second while still 0200.

Is this another quirk with the crond that Slackware uses?

Thanks
 
Old 01-06-2024, 08:21 AM   #2
RandomTroll
Senior Member
 
Registered: Mar 2010
Distribution: Slackware
Posts: 1,972

Rep: Reputation: 271Reputation: 271Reputation: 271
I've never had this behavior, and I use crond every day. The job you scheduled ran once every second that minute.
 
Old 01-06-2024, 08:43 AM   #3
henca
Member
 
Registered: Aug 2007
Location: Linköping, Sweden
Distribution: Slackware
Posts: 990

Rep: Reputation: 674Reputation: 674Reputation: 674Reputation: 674Reputation: 674Reputation: 674
Most likely it is not crond that is sending mails every second, crond can only run things once every minute. During the years, I have seen bugs causing crond to fork multiple crond processes. However, I do not think that you have 60 crond processes running. My guess is that you from cron have started something that is sending a lot o emails.

What does your entry in crontab look like that is causing all those mails?

regards Henrik
 
Old 01-06-2024, 11:23 PM   #4
RandomTroll
Senior Member
 
Registered: Mar 2010
Distribution: Slackware
Posts: 1,972

Rep: Reputation: 271Reputation: 271Reputation: 271
I configure crond to log everything in /var/log/cron. If you have yours configured for logging you can check.
 
Old 01-07-2024, 01:41 AM   #5
_peter
Member
 
Registered: Sep 2014
Location: paris
Distribution: slackware
Posts: 314

Rep: Reputation: Disabled
Quote:
Originally Posted by JinxsDad View Post
This is something I've never seen. Cron did send email this morning for my crontab entry for today ... 60 of them, to be exact. One per second while still 0200.

Is this another quirk with the crond that Slackware uses?

Thanks
Hi, no offense, this less than obscure, not even sharing your /var/spool/cron/crontabs/* .
Cron works out of the box on Slackware.

It is likely - umask 0200 - still makes the cron tasks executable for the user involved.
 
Old 01-07-2024, 07:32 AM   #6
JinxsDad
Member
 
Registered: Apr 2023
Location: Fort Walton Beach, FL
Distribution: Slackwareb15
Posts: 282

Original Poster
Rep: Reputation: 23
Quote:
Originally Posted by henca View Post
Most likely it is not crond that is sending mails every second, crond can only run things once every minute. During the years, I have seen bugs causing crond to fork multiple crond processes. However, I do not think that you have 60 crond processes running. My guess is that you from cron have started something that is sending a lot o emails.

What does your entry in crontab look like that is causing all those mails?

regards Henrik
# Run calendar -a at 0200
* 2 * * * /usr/bin/calendar -a
#

Looks right to me, unless there's yet another typo somewhere (like the missing * before).
 
Old 01-07-2024, 07:41 AM   #7
Petri Kaukasoina
Senior Member
 
Registered: Mar 2007
Posts: 1,852

Rep: Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520
You have a '*' in the minute field. That means run at any minute, at 0200, 0201, 0202, ... , 0259.
Quote:
Originally Posted by JinxsDad View Post
# Run calendar -a at 0200
* 2 * * * /usr/bin/calendar -a
To run only at 0200, any day, any month, any day of the week, you want
Code:
# MIN HOUR DAY MONTH DAYOFWEEK  COMMAND
0 2 * * * /usr/bin/calendar -a

Last edited by Petri Kaukasoina; 01-07-2024 at 07:45 AM.
 
2 members found this post helpful.
Old 01-07-2024, 07:45 AM   #8
JinxsDad
Member
 
Registered: Apr 2023
Location: Fort Walton Beach, FL
Distribution: Slackwareb15
Posts: 282

Original Poster
Rep: Reputation: 23
Quote:
Originally Posted by Petri Kaukasoina View Post
You have a '*' in the minute field. That means run at 0200, 0201, 0202, ... , 0259.


To run only at 0200, any day, any month, any day of the week, you want
Code:
# MIN HOUR DAY MONTH DAYOFWEEK  COMMAND
0 2 * * * /usr/bin/calendar -a
Fixed. Thanks.
 
Old 01-07-2024, 02:08 PM   #9
henca
Member
 
Registered: Aug 2007
Location: Linköping, Sweden
Distribution: Slackware
Posts: 990

Rep: Reputation: 674Reputation: 674Reputation: 674Reputation: 674Reputation: 674Reputation: 674
So, your original cron job were configured to run every minute betweeen 02:00 and 02:59. Once fixed to only run at 02:00, did that fix your problem? Did you really get one mail every second, or where you confused by the mails sent every minute during that hour?

regards Henrik
 
Old 01-07-2024, 02:55 PM   #10
JinxsDad
Member
 
Registered: Apr 2023
Location: Fort Walton Beach, FL
Distribution: Slackwareb15
Posts: 282

Original Poster
Rep: Reputation: 23
Quote:
Originally Posted by henca View Post
So, your original cron job were configured to run every minute between 02:00 and 02:59. Once fixed to only run at 02:00, did that fix your problem? Did you really get one mail every second, or where you confused by the mails sent every minute during that hour?

regards Henrik
Apparently I was confused by the number sent during that hour. This was first thing in the morning, pre-caffiene (it was still "brewing" in my French Press (I've had too many automatic drip coffee makers die ... a French press doesn't die).

Thanks
 
1 members found this post helpful.
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
CentOS 7.9 VPS gets overloaded - CPU - for a Little TIME around one or two per month lse123 Linux - Server 3 04-07-2023 09:01 AM
[SOLVED] Script to trigger second script--second script gets arguments of first script keif Linux - General 10 08-12-2021 01:25 AM
crontab once per week and once per month? qwertyjjj Linux - Newbie 3 12-15-2011 04:54 AM
LXer: One Laptop Per Child Gets The Green Light in India LXer Syndicated Linux News 0 12-05-2007 01:50 PM
LXer: One Laptop per Child gets first order LXer Syndicated Linux News 0 10-30-2007 04:40 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 10:58 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration