Pick up
5.
Configure Crontab, which is the timing task that Linux comes with.
Input
CRONTAB-E Start Configuration
When you open it you'll see a lot #
On the last line
Input
*/60 * * * * sh/home/pi/desktop/check.sh
Save, exit, installing new crontab appears
/60 means the interval is 60 minutes, or 1, is the interval 1 minutes
Write in the check.sh.
echo "Current time: ' Date ' +%f%T '." >> Ip.log
echo "This is my internal IP address." >>ip.log
Ifconfig | grep ' Bcast ' | cut-d b-f 1 >> ip.log
Python mail.py
echo "Master,i has sent you an email.please check!" >>ip.log
Save, exit
Wait 60 minutes after the discovery and did not receive the message.
I crontab instructions in various attempts, check.sh various changes, view crontab log, all kinds of Google found: must be the right!
chmod 777 check.sh
sudo reboot
After waiting 60 Minutes again, you should be able to receive hard-won emails.
If the test encountered a bug, how also can not solve, you may first change to/1, write the file log, view crontab execution log to solve.
Congratulations, you can now use the Raspberry Pi to make your own IP address automatically sent to your own mailbox by email every hour.
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Raspberry Pi Combat 4: Configure one hour to send a message