Crontabs: Automating Python Scripts

The command line tool

import sys
if sys.argv == 'runcron':
runcron()

The Problem

Setting up Crontabs

* * * * * cd /path/to/script/directory && /path/to/python3 /path/to/script 

Voila

if __name__ == "__main__":    
run_cron("awesomeDatabase")

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store