Skip to content

Commit 162bc2a

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

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,24 @@ 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+
26+
Use https://crontab.guru/ as reference.
27+
28+
2) Run `crontab -e` to edit the cron file.
29+
30+
3) Put in a new line: `<crontab expression> <full path to python> <full path to script>`
31+
32+
For example, a new line could be `30 * * * * /usr/bin/python /Users/johndoe/projects/bamboo_to_officespace.py`
33+
34+
Save the file and exit the editor.
35+
36+
4) `crontab -l` to check if the new settings apply. You should see the latest task in the list.

0 commit comments

Comments
 (0)