Skip to content

Commit bba002a

Browse files
committed
Add basic cron instructions
1 parent 6d7a02d commit bba002a

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,18 @@ sudo easy_install pip
1313
sudo pip install --upgrade pip
1414
pip install requests
1515
```
16+
17+
## Optional: Scheduling via `crontab`
18+
19+
If you wish to schedule the script to run at specific intervals,
20+
you have to set up a cron job.
21+
22+
1) Decide the frequency at which you want to run the script and note the cron
23+
expression for it. For example, if you want to run it every hour,
24+
the cron expression would look like "0 * * * *".
25+
Use https://crontab.guru/ as reference.
26+
2) Run `crontab -e` to edit the cron file.
27+
3) Put in a new line: `<crontab expression> <full path to python> <full path to script>`
28+
For example, a new line could be `30 * * * * /usr/bin/python /Users/johndoe/projects/bamboo_to_officespace.py`
29+
Save the file and exit the editor.
30+
4) `crontab -l` to check if the new settings apply. You should see the latest task in the list.

0 commit comments

Comments
 (0)