Ask coding questions

← Back to all posts
how to schedule a bash command?

I'm new to python and replit. I created the to run background schedule without halting the bot.
I use python to run it in shell. But it was reset and never kept running although my repl is "Always-on".
So, I'm wondering how can auto run this code python with scheduled time?
I do not want to put it in because once I run the scheduler task, the main web funtion cannot be used as it waits for scheduler task to be completed.
So, I need to run it as a separate file...
Any idea or advices are appreciated. I have been searching allover the place and couldn't find the solution yet.
Thank you.


I found the solution by myself last night and I'm pretty happy about it.
I just added this code in another file and call keep_alive() before It works like a charm. Thanks so much to Beau Carnes's tutorial on how to code a bot. Below is my code that make it work to call auto whenever the repl is restarted.