semi-busted cron entries

Hello Community:

my user cron has stopped executing any cron jobs except one.


MAILTO=jj@domain.com
*/1 * * * * /home/jj/Documents/cirrhus9/Accounts/Norveld/3WeekTest/norveldchk2.sh > /dev/null 2>&1
30 23 * * * /home/jj/bin/baculasql.sh > /dev/null 2>&1
00 08 * * 6  /home/jj/bin/ftb.sh  > /dev/null 2>&1
59 23 * * * /home/jj/bin/c9internalS3_du.sh

only the norveldchk2.sh is being run says

tail -f /var/log/messages | grep -i cron

all .sh scripts are 700.

I just recently added the MAILTO=jj@domain.com to my crontab, so I may have some email on this subject soon.

I can’t tell when this started.

Any ideas?

Hi
So the email is working, as in use mailx to send a test message?

Yes, email is working.
Tested with

echo TEST| mail user@domain.com

whether or not the cron mailto works, I will know tomorrow morning.

Thanks Malcom!

On 2012-06-19 22:36, Habitual wrote:
>
> Hello Community:
>
> my user cron has stopped executing any cron jobs except one.
>
>
> Code:
> --------------------
>
> MAILTO=jj@domain.com
> */1 * * * * /home/jj/Documents/cirrhus9/Accounts/Norveld/3WeekTest/norveldchk2.sh > /dev/null 2>&1
> 30 23 * * * /home/jj/bin/baculasql.sh > /dev/null 2>&1
> 00 08 * * 6 /home/jj/bin/ftb.sh > /dev/null 2>&1
> 59 23 * * * /home/jj/bin/c9internalS3_du.sh
>
> --------------------

Whose crontab is that?

Well, the first thing to do is removing those devnull thingies. How do you
expect to debug cron job problems with no output?

Then you have to make sure that plain mail command sending to
jj@domain.com” works. The plain “mail” command, mind, not thunderbird.

> have some email on this subject soon.

It should be instantly, less than a second. And the line typically is:


MAILTO="localusername"


Cheers / Saludos,

Carlos E. R.
(from 11.4 x86_64 “Celadon” at Telcontar)

Robin and Co:

whoami
jj

updated cron:


MAILTO="jj"
*/1 * * * * /home/jj/Documents/cirrhus9/Accounts/Norveld/3WeekTest/norveldchk2.sh > /dev/null 2>&1
30 23 * * * /home/jj/bin/baculasql.sh
00 08 * * 6  /home/jj/bin/ftb.sh 
59 23 * * * /home/jj/bin/c9internalS3_du.sh

I left norveldchk2.sh alone since it is working.

whoami && mail

jj
No mail for jj

A full 5 minutes after editing.

It’s late here. see you all tomorrow.

On 2012-06-20 03:56, Habitual wrote:

>
> jj
> No mail for jj
>
> A full 5 minutes after editing.

but the entries run at 23:30, 08:00 and 23:59, you have to wait until the
corresponding hour for each entry. If the time passes and you see no email,
check the messages log and the mail log.


Cheers / Saludos,

Carlos E. R.
(from 11.4 x86_64 “Celadon” at Telcontar)

Understood.
Subject: Cron <jj@MyKung-Fu> /home/jj/bin/c9internalS3_du.sh
From: jj@linux.local (Cron Daemon)

Progress. I can’t believe I pulled a dunce move and didn’t remove the redirection and/or piping first.
Too many terminals, so little time, I guess.

Thanks!

On 2012-06-20 14:26, Habitual wrote:

> -Understood-.
> Subject: Cron <jj@MyKung-Fu> /home/jj/bin/c9internalS3_du.sh
> From: jj@linux.local (Cron Daemon)

:slight_smile:

> Progress. I can’t believe I pulled a dunce move and didn’t remove the
> redirection and/or piping first.
> Too many terminals, so little time, I guess.

It happens.

> Thanks!

Welcome :slight_smile:


Cheers / Saludos,

Carlos E. R.
(from 11.4 x86_64 “Celadon” at Telcontar)

Well, progress is subjective, I guess. :frowning:

Jun 20 23:59:01 localhost /USR/SBIN/CRON[11201]: (jj) CMD (/home/jj/bin/c9internalS3_du.sh)

ran but no email.

Habitual wrote:
> Well, progress is subjective, I guess. :frowning:
>
>
> Code:
> --------------------
> Jun 20 23:59:01 localhost /USR/SBIN/CRON[11201]: (jj) CMD (/home/jj/bin/c9internalS3_du.sh)
> --------------------
> ran but no email.

IIRC, when a job produces no output, no email is sent. Could that be the
reason? Also IIRC, it’s possible to override that so an empty email is
sent. Or you can add ‘echo date’ to your command, or somesuch.

Well, here’s the entirety of that particular script…


#!/bin/bash
echo $(date '+%m-%d-%Y.%s') $(ssh -qi /home/jj/.ssh/c9/moose_rsa root@xx.xx.224.62 du -sh /c9backups/) >> "/home/jj/Documents/cirrhus9/WebResources/SAN or Storage/C9G2LH/c9g2lh_du.out"
#EOF

echo’d date?

Thanks!

Habitual wrote:
> Well, here’s the entirety of that particular script…
>
> Code:
> --------------------
>
> #!/bin/bash
> echo $(date ‘+%m-%d-%Y.%s’) $(ssh -qi /home/jj/.ssh/c9/moose_rsa root@xx.xx.224.62 du -sh /c9backups/) >> “/home/jj/Documents/cirrhus9/WebResources/SAN or Storage/C9G2LH/c9g2lh_du.out”
> #EOF
>
> --------------------
>
> echo’d date?

Well, echoed into a file, not to standard output. So there’s no output
for cron to report

modified c9internalS3_du.sh …


#!/bin/bash
echo date
echo $(date '+%m-%d-%Y.%s') $(ssh -qi /home/jj/.ssh/c9/moose_rsa root@71.19.224.62 du -sh /c9backups/) >> "/home/jj/Documents/cirrhus9/WebResources/SAN or Storage/C9G2LH/c9g2lh_du.out"
#EOF

tomorrow will tell. :slight_smile:

Thanks for your help.

On 2012-06-21 17:16, Habitual wrote:
>
> Well, progress is subjective, I guess. :frowning:
>
>
> Code:
> --------------------
> Jun 20 23:59:01 localhost /USR/SBIN/CRON[11201]: (jj) CMD (/home/jj/bin/c9internalS3_du.sh)
> --------------------
> ran but no email.

You should see an entry in the messages log that the job runs. The email
would contain the normal output to screen of the command, if any; if there
is none, there is no email.


Cheers / Saludos,

Carlos E. R.
(from 11.4 x86_64 “Celadon” at Telcontar)

You’ve got Mail!

>N  1 jj@linux.local     Thu Jun 21 23:59   22/686   Cron <jj@MyKung-Fu> /home/jj/bin/c9internalS3_du.sh

Next! rotfl!

Habitual wrote:
> You’ve got Mail!

Good news!

Yes, it is! But I am confused why “all of a sudden” the crontab’d scripts now need an “echo date” in them to get mail…
These were working without them for about a year. I did see an update to cron|cronie recently, but the mail
wasn’t working before that.

Oh well. Gotta stay flexible.

Have a Great Day!

Habitual wrote:
> djh-novell;2470724 Wrote:
>> Habitual wrote:
>>> You’ve got Mail!
>> Good news!
>
> Yes, it is! But I am confused why “all of a sudden” the crontab’d
> scripts now need an “echo date” in them to get mail…

I have one system that normally sends me useful mail but occasionally
sends me a mail saying that the output is binary. When I examine the
‘binary’ attachment, it’s just plain text like all the other messages.

At least it keeps Murphy busy so he doesn’t mess up other things.

On 2012-06-22 16:16, Habitual wrote:

> Yes, it is! But I am confused why “all of a sudden” the crontab’d
> scripts now need an “echo date” in them to get mail…

Putting an echo forces the script to do some output to “console”, and that
is what gets emailed. If there is no output, there is no email. I think
there is a setting somewhere that forces cron to send emails even when
there is no output.


Cheers / Saludos,

Carlos E. R.
(from 11.4 x86_64 “Celadon” at Telcontar)