Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- echo "/opt/product/bin/job.sh data123"|at -m NOW
- echo "/opt/product/bin/job.sh dataA"|batch
- echo "/opt/product/bin/job.sh dataB"|batch
- echo "/opt/product/bin/job.sh dataC"|batch
- command; echo "Process done" | mail -s "Process done" mail@domain.tld
- trap 'mail -s "Process done" mail@domain.tld' exit # It will mail on normal exit
- trap 'mail -s "Process interrupted" mail@domain.tld' INT HUP# it will mail on interrupt or hangup of the process
- #!/usr/bin/python
- import smtplib
- sender = 'from@fromdomain.com'
- receivers = ['to@todomain.com']
- message = """From: From Person <from@fromdomain.com>
- To: To Person <to@todomain.com>
- Subject: SMTP e-mail test
- This is a test e-mail message.
- """
- try:
- smtpObj = smtplib.SMTP('localhost')
- smtpObj.sendmail(sender, receivers, message)
- print "Successfully sent email"
- except SMTPException:
- print "Error: unable to send email"
- curl -s
- -F "token=APP_TOKEN"
- -F "user=USER_KEY"
- -F "message=The build is done."
- https://api.pushover.net/1/messages.json
- process_watcher --pid 1234 --to me@gmail.com
- [+] indicates the argument may be specified multiple times, for example:
- process-watcher -p 1234 -p 4258 -c myapp -c "execd+" --to person1@domain.com --to person2@someplace.com
- optional arguments:
- -h, --help show this help message and exit
- -p PID, --pid PID process ID(s) to watch [+]
- -c COMMAND_PATTERN, --command COMMAND_PATTERN
- watch all processes matching the command name. (RegEx pattern) [+]
- -w, --watch-new watch for new processes that match --command. (run forever)
- --to EMAIL_ADDRESS email address to send to [+]
- -n, --notify send DBUS Desktop notification
- -i SECONDS, --interval SECONDS
- how often to check on processes. (default: 15.0 seconds)
- -q, --quiet don't print anything to stdout
- mail-after <your command>
- # Check that "pgrep $PROGRAM" returns the rid PID.
- PROGRAM=foo
- RECIPIENTS=you@yours.com
- 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