Trying to setup cron job with a new service and custom start command
alaya25
HOBBYOP

3 months ago

Hi there,

I am trying to setup a cron job with a new service (which is duplicated from the main service) and a 'custom start command' to point to python.py, but by default the 'custom start command' for my new service is pointed to gunicorn (which is the start up for the main service : flask web server) which is not editable.

I require this 'custom start command' to be edited to point to python.py , but from the railway dashboard this 'custom start command' isnt editable.

How do i make the 'custom start command' editabe? (I have set all the environment variables already accordingly in the new service)

Also just another question - is this the best way of configuring the cron (since there are 2 duplicated services , each service has to install the same dependencies, same code - which might be resource heavy) , any better way of doing this?

Solved$10 Bounty

Pinned Solution

uxuz
MODERATOR

2 months ago

Delete the start command from your railway.json and specify it in the dashboard. This way, you can edit it when needed, such as deploying another service as cron from the source.

6 Replies

Railway
BOT

3 months ago

Hey there! We've found the following might help you get unblocked faster:

If you find the answer from one of these, please let us know by solving the thread!


Status changed to Awaiting Conductor Response ray-chen 3 months ago


uxuz
MODERATOR

3 months ago

Hey, the start command should be editable, do you have any Railway configuration files such as railway.json? Duplicating the same service with different entry points is the go to way for setting up crons.


Status changed to Awaiting User Response Railway 3 months ago


alaya25
HOBBYOP

3 months ago

Hi Uxuz, thanks for your reply, yes i do have Railway configuration railway.json.. but the 'custom start command' is not editable..


Status changed to Awaiting Conductor Response Railway 3 months ago


alaya25

Hi Uxuz, thanks for your reply, yes i do have Railway configuration railway.json.. but the 'custom start command' is not editable..

uxuz
MODERATOR

3 months ago

Hey, can you show a screenshot of your service settings regarding the start command? This value should be editable, unless you have explicitly defined a start command in your railway.json file.


Status changed to Awaiting User Response Railway 3 months ago


alaya25
HOBBYOP

3 months ago

I think that was the reason , start command was 'gunicorn app:app...' which is the flask web server defined in the railway.json file.. heres a screenshot.

when i hover my mouse on the 'custom start command' it doesnt allow me to edit it.

Selected image presented in a lightbox.


alaya25

I think that was the reason , start command was 'gunicorn app:app...' which is the flask web server defined in the railway.json file.. heres a screenshot. when i hover my mouse on the 'custom start command' it doesnt allow me to edit it.

uxuz
MODERATOR

2 months ago

Delete the start command from your railway.json and specify it in the dashboard. This way, you can edit it when needed, such as deploying another service as cron from the source.


Status changed to Solved brody 3 months ago


Loading...