Search code examples
cronjupyterexecutenbconvert

jupyter nbconvert execute to html cron job not working


I have this .sh to schedule in cron (ubuntu 18):

#!/bin/sh
wget -O x/doc1.csv  https://www.x.com
wget -O x/doc2.csv  https://www.y.com
jupyter nbconvert --execute --to html x/notebook.ipynb

The first two lines runs perfectly but the jupyter line does not. If I execute the .sh directly with ./ in the terminal, it performs well. Any idea?


Solution

  • I just add the path to the command and it worked:

    #!/bin/sh
    wget -O x/doc1.csv  https://www.x.com
    wget -O x/doc2.csv  https://www.y.com
    /home/pakin/anaconda3/bin/jupyter nbconvert --execute --to html 
    x/notebook.ipynb