콘텐츠로 건너뛰기

Emme 3 작업 완료 후 이메일 보내기

본 글은 INRO의 Emme 3에서 emme2notify 매크로를 이용하여 특정 작업 후 이메일을 보내는 방법에 대한 내용을 담고 있다1.

작업 순서

EMME2NOTIFY는 Emme 3에서 이메일을 발송하는 매크로로, Emme 3가 설치되어 있는 디렉터리 아래 macros에 있는 emme2notify 매크로를 사용한다. 이 매크로를 이용하면 노선배정traffic assignment, 또는 통행배정 등의 작업이 완료된 후에 결과 등을 메일로 보낼 수 있다2.

사용 방법

emme2notify 매크로는 아래와 같은 옵션과 파라미터를 이용해 실행한다.

~<emme2notify [--version|-h] -f from_addr -t to_addr -s subject -m msg -o smtp_outgoing_server [-a file]

옵션 및 파라미터

emme2notify 매크로에 사용되는 옵션과 파라미터는 아래와 같다.

--version프로그램의 버전 정보를 보여줌
-h (혹은 --help)프로그램의 버전 정보, 사용 방법, 가능한 옵션을 요약하여 보여줌
-f (혹은 --from=) from_addr보내는 사람의 이메일 주소 from_addr를 이용
-t (혹은 --to=) to_addr받는 사람의 이메일 주소 to_addr를 이용
-s (혹은 --subject=) subject이메일 제목
-m (혹은 –-message=) msg이메일 내용
-o (혹은 --SMTP_outgoing=) smtp_outgoing_server이메일 발송에 사용되는 SMTP 서버
-a (혹은 --include_file=) filefile 파일을 이메일에 첨부 (선택 사항)

※ 제목이나 내용에 공백이 들어갈 경우 MS윈도 시스템에서는 큰 따옴표(“), 리눅스 시스템에서는 작은 따옴표(‘)와 큰 따옴표(“)를 사용해야 한다.

※ EMME2NOTIFY는 command line prompt3에서 사용할 수 있다.

사용 예

아래는 노선배정 매크로에서의 사용 예다.

~/assignau.mac
m=5.11
~+;1;~?q=2;2
~+;6;2; ;c; ;auds;mf4; ; ; ; ;15;.10;.10
m=5.21
~+;~?=2;2
~!emme2notify -f tester@abc.yz -t tester@abc.yz -s "Assignment finished" -m "Auto assignment finished: see reports"

아래는 배치 파일에서의 사용 예다.

call emme -ng 000 -m notify.mac
call emme2notify -f tester@abc.yz -t tester@abc.yz -s "Assignment finished" -m "Auto assignment finished: see
reports" -a c:\emme\projects\city2000\reports -o server.domain_name.yz

아래는 배쉬 스크립트에서의 사용 예다.

#~/bin/bash
Emme -ng 000 -m transit.mac
emme2notify -f tester@abc.yz -t tester@abc.yz -s "Assignment done" -m "Transit assignment finished: see
reports" -o server.domain_name.yz -a c:\emme\projects\city2000\reports

기타 정보

테스트 환경

  • 운영체제 Microsoft Windows XP Professional K
  • 기타 환경 Service Pack 3
  • 프로그램1 Emme version 3.0.36 (Qt version 3.3.5 사용)
  • 프로그램2 INROkey Server 2.0.1

  1. Emme Prompt Manual Release 3.0 (Feburary 26, 2007)5 Macros “5.2.3 Emme2notify: send an e-mail when process is finished”(5-39 페이지), 7 Standalone Utilities “7.4 EMME2NOTIFY: Send e-mail to notify when process complete”(7-9~10 페이지)의 내용을 참고하였음. ↩︎
  2. 응용하면 결과 report 파일 등을 압축하여 메일로 보낼 수도 있다. ↩︎
  3. Emme Prompt console이나 매크로에서 command escape(~!)를 이용하거나, 배치 파일batch file 혹은 배쉬 스크립트bash script를 이용한다. ↩︎

댓글 남기기

이메일 주소는 공개되지 않습니다. 필수 필드는 *로 표시됩니다