This repo contains a series of scripts that can be used with cron to automate tasks on your linux system.
-
Create a
config.py
file that contains the following constants.SENDER_EMAIL = "sender@example.com" RECIEVER_EMAIL = "reciever@example.com" APP_PASSWORD = "########" (gmail app password)
-
Setup the cronjob for collecting network data. Run
collect_wifi_data.py
every hour:0 * * * * /usr/bin/python3 /path/to/collect_wifi_data.py
-
Setup the cronjob for emailing the report. Run
email_wifi_report.py
at the end of the week:59 23 * * 6 /usr/bin/python3 /path/to/email_wifi_report.py
- Setup the cronjob. Run
system_update.sh
every day at 0300. This must be added to the root crontab for correct permissions.0 3 * * * /bin/bash /path/to/system_update.sh
Send a morning newsletter email containing the latest news headlines, weather forecast, and stock market info
- Create a
config.py
file that contains the following constants.SENDER_EMAIL = "sender@example.com" RECIEVER_EMAIL = "reciever@example.com" APP_PASSWORD = "########" (gmail app password) WEATHER_TOKEN = "########" (openweathermap.com API key) LATITUDE = "40.730610" LONGITUDE = "-73.935242" TIMEZONE = "US/Eastern" FIREFOX_BINARY = "/path/to/firefox" GECKO_DRIVER = "/path/to/geckodriver" STOCKS = ["MSFT", "AAPL", "NVDA", "AMZN"] MARKET_TOKEN = "########" (financialmodelingprep.com API key)
- Setup the cronjob. Run
newsletter.py
every morning:55 3 * * * /usr/bin/python3 /home/ralph/Documents/cron-jobs/newsletter.py