Dear members,
I am unable to figure out how to schedule streamlit app using crontab. when I try to start it using crontab the app does not start.
Dear members,
I am unable to figure out how to schedule streamlit app using crontab. when I try to start it using crontab the app does not start.
Hi @YogKar, welcome to the Streamlit community!
Streamlit is a web framework; implicit in that design is the expectation that the website would just be running. What use case are you solving for?
Best,
Randy
Sorry for my late reply.
I am using streamlit as a custom UI to shoot my stockmarket buy and sell orders. I used authentication (SSO)based on the example provided on the site. but even after login and Cookies are enabled, it’s too slow as it executes the whole again(the code runs authentication too to check if you are already logged in). and the order takes a couple of seconds to shoot. My simple UI takes a max of 0.1 Seconds to shoot. and in some cases, it even gets executed in 8ms.
So if I don’t use authentication, my UI can be used by anyone who knows my server IP and Port.
so to minimize my exposure to unintended use. I was looking to automate it using crontab but I was not successful.
I am using tmux and kill it when not required. But I do this manually.
Please suggest to me if there is a way out.
Apart from this few things I need and am struggling with ;
Thanks.
I got crontab to work by creating a script that has the python shebang set to the required version for your app and then the streamlit command.
vim /bin/start-app.sh
#!/usr/bin/python3.9
streamlit run /path/to/app.py
and then in crontab I set my start at every reboot “@reboot /bin/sh /bin/start-app.sh”
make sure your /bin/start-app.sh is executable.
it only worked when doing it this way, with the /bin/sh in crontab.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
These cookies are necessary for the website to function and cannot be switched off. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms.
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us understand how visitors move around the site and which pages are most frequently visited.
These cookies are used to record your choices and settings, maintain your preferences over time and recognize you when you return to our website. These cookies help us to personalize our content for you and remember your preferences.
These cookies may be deployed to our site by our advertising partners to build a profile of your interest and provide you with content that is relevant to you, including showing you relevant ads on other websites.