| CPUG | |
| The Check Point User Group | |
| A Resource For The Check Point Community. Fast. Useful. Independent. | |
|
| |||||||
![]() |
| | LinkBack | Thread Tools | Display Modes |
| |||
| In NGX on the SPLat SmartCenter server, we have a script that FTPs our logs and writes the output to a /tmp/FTPlog.out file. At the end of the script we have a sendmail command: more /tmp/FTPlog.out | /opt/CPsuite-R60/fw1/bin/sendmail -s CPTMGT-LogArchive emailacct@xxx.com This script works great when it is invoked manually and I get the email, but when it executes via cron, then the script works but I don't get the email. Does anyone know why sendmail does not work with cron? The first line of the script is: #!/bin/bash -x Thanks. |
| |||
| There isn't anything in /var/log/messages to indicate a problem: Mar 23 00:45:00 cpt-mgt CROND[8425]: (root) CMD (/usr/SCRIPTS/FTPlog.sh) Mar 24 00:45:00 cpt-mgt CROND[28118]: (root) CMD (/usr/SCRIPTS/FTPlog.sh) |
| |||
| edit your script more /tmp/FTPlog.out | /opt/CPsuite-R60/fw1/bin/sendmail -s CPTMGT-LogArchive emailacct@xxx.com 1>/tmp/scr.log 2>&1 and after execution script check file /tmp/scr.log |
| |||
| Here's what shows up in the scr.log file: /opt/CPsuite-R60/fw1/bin/sendmail: error while loading shared libraries: libcppr od50.so: cannot open shared object file: No such file or directory |
| |||
| I doubt this is the problem but try it with "cat" instead of "more". Also make sure the cron job is running as admin or someother defined user and not root. You want to make sure you get the correct environment. (your ldlibiarypath (sp?) might well be wrong). |
| |||
| The problem is resolved, though I may have resolved it the wrong way (?) When I was logged into the SPLat box as admin, I did: echo $LD_LIBRARY_PATH I took that info and used the export command in the script to set the same variable: export LD_LIBRARY_PATH='/opt/spwm/lib:/opt/CPshrd-R60/lib:/opt/CPsuite-R60/fw1/lib:/opt/CPsuite-R60/fg1/lib:/opt/CPportal-R60/webis/lib:/opt/CPportal-R60/portal/lib':$LD_LIBRARY_PATH It works like a charm. Does anyone see a problem with doing this? |
![]() |
| Thread Tools | |
| Display Modes | |
| |