1

Is it possible to schedule a Python script on Azure Notebooks?

I've written a simple script saved as test.py: enter image description here

That runs absolutely fine when I run it in the terminal as

python library/code/test.py

I've got a cron that looks like this: enter image description here

But nothing is produced when I save the cron. I've set it as * * * * * so there's no opportunity for confusion with timezones just whilst I'm testing.

I can't find where the cron might be emailing me errors and outputs within the Azure environment. My root directory looks like this and there's nothing in mail:

enter image description here

tktk234
  • 426
  • 3
  • 12

1 Answers1

0

Have you tried to capture all the output. Here's a sample crontab entry set up to capture all the output:

59 13 05 06 * { /usr/bin/python /path/to/myscript.py -i /path/to/input.txt --log --timer ; } > /tmp/myProj/myscriptPY.trace.`/bin/date +\%Y\%m\%d.\%H\%M` 2>&1

Simple idea is to save jupyter notebook to local and write a shell script to submit the python script. Something like /bin/bash -c "/path/to/python /path/to/script ...". It could help,As it seems that cron uses /bin/sh to execute it's commands.

Try this and see if it helps.

Mohit Verma
  • 5,140
  • 2
  • 12
  • 27