duoan / notes

Classtag's Notebooks
https://github.com/classtag/notebook/issues
9 stars 3 forks source link

A jupyter start bash script #25

Open duoan opened 6 years ago

duoan commented 6 years ago

Hi, community: I have write a very sample script for start or stop jupyter on my own laptop. Share with you. Wish it help you.

#!/bin/sh
cmd=$1
if [ "$1" = "start" ]; then
    echo "starting jupyter notebook................."
    nohup /Users/duoan/anaconda/bin/jupyter-notebook --notebook-dir="$HOME/Documents/nbs" > /tmp/jupyter.log 2>&1 &
    echo "jupyter notebook has started.............."
elif [ "$1" = "stop" ]; then
    echo "stoping jupyter notebook.................."
    pgrep -f jupyter | xargs kill
    echo "jupyter notebook has stoped..............."
else
    echo "Usage:pnote (commands ... )"
    echo "commands:"
    echo " start Strat Jupyter Notebook"
    echo " stop Stop Jupyter Notebook"
fi