Forked from umich-ulcs-monitor. This program monitors availability of Canyon Campground at Yellowstone National Park.
-
Configure
SENDER_EMAIL
,SENDER_PASSWORD
,RECEPIENT_EMAILS
, andUPDATE_INTERVAL
inmonitor.py
. -
Run the script
$ python3 monitor.py
-
To exit, press
Ctrl+C
.- If the process failed to exit properly, refer to this link.
We can choose to deploy the program on a virtual machine. Popular service providers include Microsoft Azure Student and Amazon AWS Educate. Given the free credits for students, we can establish a virtual machine for free.
We will use tmux
to run the program so that it will continue running after the ssh session disconnects. Learn more about other approaches and a beginner guide to tmux
.
-
On your virtual machine, start
tmux
with a new session$ ssh azure $ tmux
-
Run the program in the session
$ python3 monitor.py
-
Detach from the session by pressing
C-b d
, which means pressCtrl+b
, release, and then pressd
. You will get the output[detached (from session 0)]
-
Disconnect ssh as you want
$ exit
-
After reconnecting to ssh, attach to
tmux
session$ ssh azure $ tmux attach
The program should still be running properly.