Multiple cron jobs in a single python file

nworbdierHOBBY

3 months ago

Hi there!

Does railway support running multiple (and different) cron schedules for a single python file? I have something I need to run every two hours and then one script I just need to run once daily!

Thanks so much!

Solved

0 Replies

nworbdierHOBBY

3 months ago

5145c507-f1f3-4fe5-ba5b-fc6296e6e095


3 months ago

Do you mean like two different python scripts in a single repository?


nworbdierHOBBY

3 months ago

Yes that's correct! I need one script to run every 2 hours (main.py) and one to run once daily at 5pm (archive_projections.py)


3 months ago

What you could do is to deploy the same service twice but with two different configurations. Such as modifying the start command https://docs.railway.com/guides/start-command and the cron schedule.


nworbdierHOBBY

3 months ago

Okay i can do that! Thanks!


3 months ago

you are welcome!


3 months ago

This is correct, thanks for the help uxuz!


3 months ago

!s


Status changed to Solved adam 3 months ago