Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- ps auxw | grep my_script | grep -v grep > /dev/null
- if [ $? != 0 ]
- then
- echo "Process is not running."
- source /path/to/venv/bin/activate #start python environment
- export PYTHONUNBUFFERED=yes #to allow for running log output
- python /path/to/my/script/my_script.py >> /path/to/my/script/logs/output.log &
- fi
Add Comment
Please, Sign In to add comment