Attching Monitor log file in mail as attachment

Hello,

Need your help guys, I have a requirement. When the job is executed it has to send the trace log file as an attachment. The trace log file which changes every time when the job executes. Can you guys help me out on how to pick up dynamically the trace log file and send that trace log file as an attachment.

Thanks,
Bharat


048886 (BOB member since 2013-11-11)

Hiya,

To send the complete trace log as an attachment requires mailing it after the job has finished. This can be done in a script near the end of your job by identifing the trace log filename via function get_trace_filename(), callling the exec function with flag 256 (to run independently of Data Services), and with a pause to allow the job to finish before actually mailing. On Windows the pause can be done via timeout.exe (if available) or you can use ping with a timeout value.

The final exec command for Windows could look something like this (as an idea, it’s not complete),

exec(‘cmd’, ‘/c ping 1.1.1.1 -n 1 -w 5000 > nul & mailer -a"[$TRACELOG_FILENAME]" -f … -t … -s …’, 256);


somebodi :australia: (BOB member since 2010-08-04)