Advertisement
Guest User

Untitled

a guest
Apr 20th, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.33 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. ps auxw | grep my_script | grep -v grep > /dev/null
  4. if [ $? != 0 ]
  5. then
  6.     echo "Process is not running."
  7.     source /path/to/venv/bin/activate #start python environment
  8.     export PYTHONUNBUFFERED=yes #to allow for running log output
  9.     python /path/to/my/script/my_script.py >> /path/to/my/script/logs/output.log &
  10. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement