Artem
Artem

Reputation: 17

How to run python code a the time I want, from terminal mac Os

I'm ratheк new to programming, and my question is rather simple: How to run a bunch of code at time that I want? what I mean is simply how to write a programm or a command in Terminal on macOs (I'm using 10.7) that will run python code at 3 o'clock AM. If python programm lies into:

/Users/name/Documents/prog.py

To run the programm simply from Terminal I use:

cd /Users/name/Documents/
python prog.py 
'hit Enter'

Upvotes: 0

Views: 410

Answers (1)

zzk
zzk

Reputation: 1387

You need cron: http://en.wikipedia.org/wiki/Cron

Cron is the time-based job scheduler in Unix-like computer operating systems. Cron enables users to schedule jobs (commands or shell scripts) to run periodically at certain times or dates.

Upvotes: 4

Related Questions