简体   繁体   中英

Scheduling on Azure Notebooks

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

I've written a simple script saved as test.py : 在此输入图像描述

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: 在此输入图像描述

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 :

在此输入图像描述

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM