Cron
chandlergims
HOBBYOP

a year ago

My cron job won't run and nothing I do will fix it.

$10 Bounty

7 Replies

chandlergims
HOBBYOP

a year ago

30b3d9a3-52b6-46bb-a15d-66daefbd682e


chandlergims
HOBBYOP

a year ago

[build]
builder = "nixpacks"
buildCommand = "echo 'Building from railway.toml' && npm run build"

[deploy]
startCommand = "echo 'Starting from railway.toml' && npm run start:cron"
healthcheckPath = "/"
healthcheckTimeout = 100

[[cron]]
schedule = "*/6 * * * *"
command = "echo \"Running cron job at $(date)\" && curl -v -X GET $RAILWAY_PUBLIC_DOMAIN/api/cron/update-prices"

chandlergims
HOBBYOP

a year ago

thats my railway toml, shows both build and deploy echo in logs but never cron.


chandlergims
HOBBYOP

a year ago

1383611936490651758


chandlergims
HOBBYOP

a year ago

looks like my cron is completly ignored ignore the highlighted stuff but cron doesnt show here once ?


a year ago

At first glance that railway.toml looks wrong, it looks like it uses unsupported syntax.

Please transition to a json config so that you can have your IDE validate it.


phoenixauro
HOBBY

a year ago

Change the cron command to

command = "echo \"Running cron job at $(date)\" && curl -v -X GET https://$RAILWAY_PUBLIC_DOMAIN/api/cron/update-prices"

if that doesn't work try

command = "echo \"Running cron job at $(date)\" && curl -v -X GET https://${RAILWAY_PUBLIC_DOMAIN}/api/cron/update-prices"

or

command = "echo \"Running cron job at $(date)\" && curl -v -X GET https://${{RAILWAY_PUBLIC_DOMAIN}}/api/cron/update-prices"


Welcome!

Sign in to your Railway account to join the conversation.

Loading...