Sometimes you need to run a Linux command that may take time (such as kernel compilation, virus scan, long test run..) instead of waiting in front of the monitor, you can do other stuff (e.g., good coffee) and you'll be notified when the command had finished with the results.
I have ATT cell phone, they support SMS2EMAIL service; simply send a message (plain text, no longer than 160 characters) to the address:
The Email address varies based on your carrier, check this website for worldwide cellular network list.
Now, we just need to run the command that takes time, and send a short text message with the report to notify us.. from a Linux machine with Email access, run this command:
(msg-body) | mail -s (msg-subject) (sms2email-address)
The message body can be the command output, or the command returned code, or anything else you want.
Examples:
a) To report the returned code of an application, run:
gcc windows.c; echo "rc=$?" | mail -s "gcc report" 4081002000@txt.att.net
This will send you the returned code (rc) of the compilation command when its done, usually zero (rc=0) indicates a successful run.
b) To compile a Linux kernel and send an SMS when done with the output tail (last 120 bytes for example), run:
a) To report the returned code of an application, run:
gcc windows.c; echo "rc=$?" | mail -s "gcc report" 4081002000@txt.att.net
This will send you the returned code (rc) of the compilation command when its done, usually zero (rc=0) indicates a successful run.
b) To compile a Linux kernel and send an SMS when done with the output tail (last 120 bytes for example), run:

0 comments:
Post a Comment