You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
671 B

4 years ago
# weather
4 years ago
Some pythonscripts that get weather data from SMHI and calculates evapotranspiration.
4 years ago
Create a user to run scripts:
````
useradd -s /usr/sbin/nologin -r -M -d /opt/weather weather
````
Clone repo:
````
git clone https://github.com/mickenordin/weather.git /opt/weather
````
Chown:
````
chown -R weather:weather /opt/weather
````
Create mysql database:
4 years ago
````
mysql -e "CREATE DATABASE weather"
4 years ago
mysql -e "CREATE USER 'weather'@'localhost' IDENTIFIED BY 'password'"
mysql -e "GRANT ALL PRIVILEGES ON weather.* TO 'weather'@'localhost'"
4 years ago
mysql weather < /opt/weather/weather.sql
4 years ago
````
Configure and run:
````
4 years ago
vim weather.ini
./getweather.py
./aggregateweather.py
````