Skip to content

rlsanders4/cron-jobs

Repository files navigation

cron-jobs

This repo contains a series of scripts that can be used with cron to automate tasks on your linux system.

Generate a weekly internet speed report (sent to your email)

  1. 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)
    
  2. Setup the cronjob for collecting network data. Run collect_wifi_data.py every hour:

    0 * * * * /usr/bin/python3 /path/to/collect_wifi_data.py
    
  3. 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
    

Update linux system with apt package manager

  1. 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

  1. 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)
    
  2. Setup the cronjob. Run newsletter.py every morning:
    55 3 * * * /usr/bin/python3 /home/ralph/Documents/cron-jobs/newsletter.py
    

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published