Skip to content

Instantly share code, notes, and snippets.

@dmitryhd
Created November 18, 2015 12:16
Show Gist options
  • Select an option

  • Save dmitryhd/4846fac52ceb8eadf686 to your computer and use it in GitHub Desktop.

Select an option

Save dmitryhd/4846fac52ceb8eadf686 to your computer and use it in GitHub Desktop.
Cron ipython runner
#!/bin/bash
# runs ipython notebook by cron
# Add to cron
# 42 14 * * * /home/user/cron_ipython_runner.sh
source $HOME/.profile
WORKDIR=/var/local/
RUNNERLOG=/tmp/recomm_runner.log
NOTEBOOK=test_notebook.ipynb
IPYTHONPATH=/usr/bin
echo 'Start recom.' > $RUNNERLOG
cd $WORKDIR
echo 'cd' >> $RUNNERLOG
$IPYTHONPATH/ipython nbconvert --to=html --ExecutePreprocessor.enabled=True $NOTEBOOK &> $RUNNERLOG
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment