Guest User

Untitled

a guest
Feb 24th, 2018
273
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.15 KB | None | 0 0
  1. echo "/opt/product/bin/job.sh data123"|at -m NOW
  2.  
  3. echo "/opt/product/bin/job.sh dataA"|batch
  4. echo "/opt/product/bin/job.sh dataB"|batch
  5. echo "/opt/product/bin/job.sh dataC"|batch
  6.  
  7. command; echo "Process done" | mail -s "Process done" mail@domain.tld
  8.  
  9. trap 'mail -s "Process done" mail@domain.tld' exit # It will mail on normal exit
  10. trap 'mail -s "Process interrupted" mail@domain.tld' INT HUP# it will mail on interrupt or hangup of the process
  11.  
  12. #!/usr/bin/python
  13.  
  14. import smtplib
  15.  
  16. sender = 'from@fromdomain.com'
  17. receivers = ['to@todomain.com']
  18.  
  19. message = """From: From Person <from@fromdomain.com>
  20. To: To Person <to@todomain.com>
  21. Subject: SMTP e-mail test
  22.  
  23. This is a test e-mail message.
  24. """
  25.  
  26. try:
  27. smtpObj = smtplib.SMTP('localhost')
  28. smtpObj.sendmail(sender, receivers, message)
  29. print "Successfully sent email"
  30. except SMTPException:
  31. print "Error: unable to send email"
  32.  
  33. curl -s
  34. -F "token=APP_TOKEN"
  35. -F "user=USER_KEY"
  36. -F "message=The build is done."
  37. https://api.pushover.net/1/messages.json
  38.  
  39. process_watcher --pid 1234 --to me@gmail.com
  40.  
  41. [+] indicates the argument may be specified multiple times, for example:
  42. process-watcher -p 1234 -p 4258 -c myapp -c "execd+" --to person1@domain.com --to person2@someplace.com
  43.  
  44. optional arguments:
  45. -h, --help show this help message and exit
  46. -p PID, --pid PID process ID(s) to watch [+]
  47. -c COMMAND_PATTERN, --command COMMAND_PATTERN
  48. watch all processes matching the command name. (RegEx pattern) [+]
  49. -w, --watch-new watch for new processes that match --command. (run forever)
  50. --to EMAIL_ADDRESS email address to send to [+]
  51. -n, --notify send DBUS Desktop notification
  52. -i SECONDS, --interval SECONDS
  53. how often to check on processes. (default: 15.0 seconds)
  54. -q, --quiet don't print anything to stdout
  55.  
  56. mail-after <your command>
  57.  
  58. # Check that "pgrep $PROGRAM" returns the rid PID.
  59. PROGRAM=foo
  60. RECIPIENTS=you@yours.com
  61. echo Watching $PROGRAM; while pgrep $PROGRAM &>/dev/null ; do sleep 1; echo -ne "."; done ; echo "$PROGRAM process done" | /bin/mail -s "$PROGRAM process done" $RECIPIENTS;
Add Comment
Please, Sign In to add comment