Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hi,
I have written a linux script with mailing mechanism which is included in crontab to excute once in an hour.But,the problem is that when the script is being executed once in an hour,I am getting two mails with an inetrval of 1 minute whereas I am supposed to get one mail.Can anyone please help me in this?
Your script also has a strange (copy-paste related?) entry:
- Is the user/apache-tomcat..........serverinfo.txt line part of the previous line? The next line also mentions this line, but it is put in a variable.
- The first line should be: #!/bin/bash (no space, although I think that bash is forgiving with this 'error').
- Maybe sendmail can use a comma separated entry for the mail receivers, but I do think that this line:
receiver_email=kaushik.das@uniform.aramark.com,debasish.mishra@tcs.com,vivek.choudhary@tcs.com
should be: receiver_email="kaushik.das@uniform.aramark.com debasish.mishra@tcs.comvivek.choudhary@tcs.com"
Hi,
Actually there are two crontab entries but the other one is working fine.So,I do not think there is anything wrong related to crontab entry.
And also the mailing part in the script is correct as the other script is working fine with the same mailing part.
Please look if there is anything wrong in the script and advice.....
Maybe you're not clear enough, but I conclude the following: 2 crontab jobs for the same shellscript = 2 times executed = 2 mails. You probably mean something else
What about the other 2 things I pointed out? (/bin/bash line and the user/apache line) any luck with that?
Did you try altering the crontab to what I suggested or did you assume that the line is ok.
One other thing, post the whole script if you want us to look at it, not only the part that you think is relevant. And put code tags around it, makes reading it a lot easier.
Hi,
the issue is resolved.I made some changes in the crontab entry
as below:
0 0-23/1 * * * bin/bash -l /home/mquser/apache-tomcat-4.1.34/webapps/ReportTemplate/Util/NodeStatus.sh
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.