I set this up in the cron tab. I want this to run every 5 mins. It is supposed to mail me. When I execute it sh load_check.sh it works fine and mails me. But I am not receiving any mails so i think it is not working. Please help me
Ok, this doesn't make any sense. " it works fine and mails me " But your not receiving the mails? so you dont think its working?
Why don't you just do this: At the top of the crontab file, include: The results should be e-mailed to you and you could remove the mailing function of your script.
Hi rahuldas14, According to your info, when you run your script manually, it works and mails you; but when you set up cron jobs, it doesn't work and you don't receive any mail, right? Here's something to try: - Is crond running? run this service crond restart Code (markup): - Where do you set up your cron? If you set up cron using crontab -e command, remove "root" */5 * * * * command_goes_here - Did you add the she-bang at beginning of your script? add this: #!/bin/sh Code (markup): - Does your script have executing permission? chmod 0777 your file. Or you can try this step by step: - enter crontab -e to open crontab file. - add this cron: */5 * * * * /bin/sh /usr/local/bin/load_check.sh Code (markup): (Do a "whereis sh" and check where your sh is. Mine at /bin/sh; some at /usr/bin/sh). Hope it helps Best regards, Nguyen An Thuan.