- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- ELM can't send attach if started thru CRON
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-15-2005 02:49 AM
03-15-2005 02:49 AM
I have a shell, that sucesufully sends 2 email with attach and 1 plain if started on prompt line.
Same shell started thru cron, can send only 1 plain email, no any traces of those 2 with attachements.
I'm using:
elm -s " $FSUB $SUBJECT" -a $MAILTO < temp3 >>$LOGFIL
here is ll for my shell:
-rwxr-xr-x 1 rpgmail users 4690 Mar 10 17:18 proc
Probably there is some mess with cron authority...
Another interesting issue that name of attach I see like
Thanks to all.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-15-2005 02:53 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-15-2005 02:55 AM
03-15-2005 02:55 AM
Re: ELM can't send attach if started thru CRON
in the cron user's home directory before running elm. Elm run interactively will automatically create this directory but the command-line invocation will not.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-15-2005 03:11 AM
03-15-2005 03:11 AM
Re: ELM can't send attach if started thru CRON
I'm attaching a production sendmail attachment script that works well with cron.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-15-2005 03:13 AM
03-15-2005 03:13 AM
Re: ELM can't send attach if started thru CRON
Pete: I do use full path, and I see my proc was ran thru timestamps, log file updates, plain email sent. The only problem that I can't recieve emails with attach.
Clay:
I have .elm, and I 100% sucesfully rinning my ./proc from prompt line, the problem with running it thru cron.
Will check you info regarding Variables.
Thanks all
Vlad
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-15-2005 03:29 AM
03-15-2005 03:29 AM
Re: ELM can't send attach if started thru CRON
I have to stick with elm, don't have a choice. Just to specified a full path to all commands, still same result.
I'm checking a status after execution of each command, and it's = 0 ???
Can't figure out, do I need do Export all $var??
Vlad
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-15-2005 03:31 AM
03-15-2005 03:31 AM
Re: ELM can't send attach if started thru CRON
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-15-2005 04:02 AM
03-15-2005 04:02 AM
Re: ELM can't send attach if started thru CRON
This proc takes control file from ftp dir, extract attach file name, email address from this control file, check it size, zip/nozip depending on size, then send file out.
There is line:
cd $WDIR that should solve all envrironmental problems, as I thought...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-15-2005 05:30 AM
03-15-2005 05:30 AM
Re: ELM can't send attach if started thru CRON
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-15-2005 05:49 AM
03-15-2005 05:49 AM
Re: ELM can't send attach if started thru CRON
I do cd $WDIR at the very beginning. I can see both tempp* there after execution.
Vlad
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-15-2005 08:37 AM
03-15-2005 08:37 AM
Re: ELM can't send attach if started thru CRON
1) Inconsistant pathname conventions
sometimes 'elm -s' and sometines '/usr/local/bin/elm -s'. I also see one that looks very suspicious 'usr/bin/unix2dos'.
You really should handle it via something like this near the top of your script:
PATH=${PATH}:/usr/local/bin # + any other needed
export PATH
You then don't need full path names. I good idea would be to match ${PATH} when you are running from a shell prompt.
2) I really dislike your hard-coded temp file names; the better answer is something like this:
TDIR=${TMPDIR:-/var/tmp}
T1=${TDIR}/X${$}_1.tmp
T2=${TDIR}/X${$}_2.tmp
and so on and then use ${T1}, ${T2} as your files.
You also need a trap statement that rm's these files upon exit or receipt of a signal.
Temp file names like this will prevent collisions when multiple instances of the same script are running. It's just good practice.
3) You do many operations without testing the result, blindly assuming all is well.
e.g.
cd ${WDIR}
# you should add a test like this:
STAT=${?}
if [[ ${STAT} -ne 0 ]]
then
echo "${0}: cd to \"${WDIR}\" failed; status : ${STAT}" >&2
exit ${STAT}
fi