![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| error in running shell script in cron | sari | Shell Programming and Scripting | 3 | 04-16-2008 05:09 AM |
| Email sending through a shell script | memonks | UNIX for Dummies Questions & Answers | 3 | 11-12-2007 12:21 AM |
| Sending attachments using email through shell script | symhonian | Shell Programming and Scripting | 6 | 01-27-2006 09:41 AM |
| sending email from KSH unix script. | rosh0623 | Shell Programming and Scripting | 3 | 07-26-2005 04:36 AM |
| Cron running shell scripts. | cfoxwell | UNIX for Dummies Questions & Answers | 3 | 09-26-2001 12:35 PM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Running a shell script in cron...email not sending - help??
I am pretty new to Unix shell scripting, but wondered if anyone could help (in layman's terms if possible!!)
![]() I have a shell script which ultimately sends an alert to an email address if part of a batch of programs fails. Here's the script that sends the email: Script: 6check.csh #!/bin/csh set alertperson = `cat /export/home/bdodym/alert.person` if (-f critabend.tag ) then cat callout6.msg | rmail $alertperson rm critabend.tag endif This is where $alertperson will be forename.surname@address.com designation in the alert.person script From the command line, all runs fine. However, if I run through cron, it still seems to be executing the scripts (e.g files are created that I'm asking the script to do generally), but the email is not being sent as I would hope. In the below crontab, 6start.sh has a number of scripts to run through, the last of which is 6check2.csh (as per above) crontab -l #!/bin/csh ############################################# # Minute Hour Month Day Month Weekday Command # ___________________________________________________________ # 0 01 * * * Job_1 # 51 * * * * /export/home/bdodym/6start.sh Does anyone know if there is anything additional I need to do add to either the script, or cron, to ensure the email sends? I think (from my VERY limited knowledge of this kind of thing!) that its something to do with the fact cron is running in the background rather than the terminal, as per the command line success. But, this is the final piece of the jigsaw and I just need to ensure I can get it to fit!! ![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|