Last active
December 26, 2019 23:54
-
-
Save rafidka/a764fa910428141bfc00aeea087af3a5 to your computer and use it in GitHub Desktop.
Run Jupyter notebook as a background process, redirecting stdout and stderr to files
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo Check whether Jupyter Notebook is already running... | |
# You need to update the path in this line to point to where your jupyter-notebook lives. | |
ps aux | grep '/home/rafidka/.pyenv/versions/3.6.8/bin/jupyter-notebook' | grep -vq grep | |
if [ $? -eq 1 ]; then | |
echo 'Jupyter Notebook is NOT running; starting it in a background process...' | |
curr_path=`pwd` | |
mkdir -p notes | |
cd notes | |
jupyter notebook --no-browser --port=9001 > $curr_path/stdout.txt 2>$curr_path/stderr.txt & | |
cd $curr_path | |
else | |
echo Jupyter Notebook is already running. | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment