Python script to automatically make changes and git add/commit/push.
Triggered via crontab & runned within virtualenv (with dependencies)
- Make changes: Add new line in txt file
- Git auto add/commit/push
- pip:
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python get-pip.py
- virtualenv, according to your installed python version:
Python 2.7x: pip install virtualenv
Python 3x: pip3 install virtualenv
or simply: python -m pip install virtualenv
- Meet requirements
- Clone repo
- Create virtualenv with
virtualenv cronGitEnv
- Activate env:
source cronGitEnv/bin/activate
- Install dependencies inside the virtualenv
(cronGitEnv) pip install Gitpython
- Setup crontab with
crontab -e
- Press
i
to edit - Paste the following to activate the env & run the python script at minute 0 every 4hs. (Check path to match with your local path)
SHELL=/bin/bash
0 */4 * * * cd projects/cronGit/cronGitEnv && source bin/activate && cd .. && python index.py
Forked from ospiegel91/cronGit