What is Cron? ⏰
The software utility cron is a time-based job scheduler in Unix-like computer operating systems. Users that set up and maintain software environments use cron to schedule jobs (commands or shell scripts) to run periodically at fixed times, dates, or intervals. It typically automates system maintenance or administration—though its general-purpose nature makes it useful for things like downloading files from the Internet and downloading email at regular intervals. - Wikipedia
Learn more 📚:
- Nice explanation on how to set up your own cron job
- Examples of cron schedules
- Some notes on running Cron:
- Cron daemon (server, service) has to run with root permission. Users then can submit their tasks to it and cron would faithfully execute the code at a specified schedule.
Some Cron jobs for Jupyter server
As an example, cron could run notebooks periodically and send diagnostics to slack channels or emails. It could run a backup script of data you are working with or schedule heavy computations at night so that the results are ready in the morning. You get the idea.
Example: Weather fetcher
This repo contains a setup showing how Cron and Jupyter server can be run together. weather_fetcher.ipynb
is executed every 2 minutes. It fetches weather data from a static API provided by OpenWeather and sends the result in a text message using Twillio.
Top comments (0)