you could try enclosing your commands and redirecting to /dev/null (i.e., * * * * * * (some_script) > /dev/null 2>&1) or you could actually go into each script and redirect all unnecessary message outputs (i.e. "rm -f /dir/file 2> /dev/null") as well as comment out all unnecessary echo lines (i.e., "# echo 'i am here') ...
Are you cron entries ending /dev/null 2>&1 or > /dev/null 2>&1?
Without a re-direct for standard output, you are just passing /dev/null as a parameter and redirecting standard error to standard out, which will still generate an e-mail.
hi all,
Im hasan.kamali's team member.
here is one of the cron entry which is generating email.
1,4,7, * * * * /med/appl/orbix2/BusinessMediation/bin/start_mediationsocket_servers > /dev/null 2>&1.
and the total script count is in hundreds and it is impossible to reevaluate each single script and add > /dev/null 2>&1 this at the end of lines.
Okay, well the re-direction appears to be okay, but I presume it is writing to a different file-descriptor then. If it is code you can read, is there anything that does a >&3, or perhaps 4, 5 .... that might be causing the e-mail. You may end up suffixing your cron records like this:-
I must say that it seems an odd definition to run a command on the first, fourth and seventh minute of every hour. It this really it? Well, there must be a need for it. Do you really have:-
A comma at the end of 1,4,7,
A full stop at the end of the record as in 2>&1.
They could be confusing things too I suppose.
What do you get if you run these on the command line? If you get output, then cron will always e-mail you. I'm assuming that the purpose of the script is not to send an e-mail, of course.
run this one as the crontab user ...
check /tmp/noredirect for the offending entries ... if /tmp/noredirect is empty, re-grep using "> /dev/null" as the search string ...
I am using centos 6.4.
I have a few cron jobs setup and they all work fine.
However, I would like to enhance one of the crons.
This is what I have at the moment:
nice rsync -au /home/samba/wsaler/* /home/samba/wsaler.backup/wsaler.backup18pm
date | /bin/mail -s "wsaler 3:00pm backup... (8 Replies)
Hi i created a cron job which invoke a shell script and output some content via email.
Some times these output are sent to the junk email folder. i want these mails to be sent to inbox with some specific font. what i have to do? (4 Replies)
Hi all,
I think this could have a simple solution, just I canīt get it so far.
I have the script below that includes several echo commands in order
to show that every part of the script have been executed. A cron job
executes this script and when is completed the output is sent by email.
... (4 Replies)
Hi guys, not sure if this would be the right place for this but I dont where else it would go... I'm new to Unix too, so please bare with me :)
I guess first up some background on the situation. We have some scripts that run as cron jobs which monitor and check the health, etc of our servers.... (2 Replies)
Hi I am new to solaris zones...........
I created a zone in solaris and i am trying to add a cron entry to that by
crontab -e but when I enter that command it is just showing 253 number.....
But when I enter crontab -l there are some entries my question is how to add cron entry??
when... (3 Replies)
Hi,
I want to run a crontab job on solaris 10.5. I have configured the crontab accordingly
10 * * * * /scripts/dbalter.pl >> /scripts/cronout.txt
However this does not work .Then I go to /var/mail/root and find an error in the output:
From root@myserver Wed Feb 4 17:02:00 2009... (1 Reply)
Hi,
I'm fairly new to Aix and am looking for some help on the following.
I have setup a cron job under root and want it to send the email once it's run to an external email address. I can get it to send the output in an email to me by using mail on the end of the crontab entry. But I would... (1 Reply)
Hi all,
Our servers were on Sun Solaris 8.1, anytime a cron job executed the user ran that job received a email of job's output. I think that the default and Administrator did not setup anything.
However, when we upgraded the OS to Sun Solaris ver.10, the cron job is no longer send a email... (2 Replies)