![]() |
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 |
| crontab couldn't run through, help | duke0001 | UNIX for Advanced & Expert Users | 10 | 02-06-2008 03:22 AM |
| Using Crontab | sumesh.abraham | Shell Programming and Scripting | 10 | 02-21-2007 06:19 AM |
| Crontab | gen4ik | UNIX for Dummies Questions & Answers | 1 | 01-18-2007 07:26 AM |
| ftp and crontab | user` | Shell Programming and Scripting | 27 | 11-13-2006 08:02 PM |
| Crontab | lo-lp-kl | UNIX for Dummies Questions & Answers | 2 | 05-05-2005 06:21 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
help with crontab
i have a ksh script that creates messages in a temp directory and then sends them out using the sendmail command and i'm trying to set it up to run every night with crontab.
So the basic gist of the script is #create temp dir and messages ... #loop through each message and send using sendmail ls $dateFolder/Group/* | \ while read tempMsg do cat $tempMsg | /usr/lib/sendmail -t done When I run the script from the command line in my home directory it works perfectly, but then when I edit my crontab file with something like: 48 23 * * * /home/users/campbelr/ddts_reminder.ksh /home/users/campbelr/ddts_reminder_config.txt the temp directory and files are created, but the sendmail command does not execute. I'm an unix shell scripting newbie, so i don't understand how this could happen. is it an environment difference? any ideas? |
|
||||
|
Try replaceing the sendmail command with /usr/bin/mailx (toaddress)
you can add a subject if you wish ie /usr/bin/mailx -s "your subject" me@myhost.com also you could use ls -1 to force a single line output for your while loop. |
|
||||
|
i need to use sendmail and not mailx because all of the header stuff: to, from, subject, etc. are stored in the message, so using the sendmail -t command simplifies things alot.
and I am using the full path to the sendmail binary /usr/lib/sendmail |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|