Cron
chandlergims
HOBBYOP

9 months ago

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

$10 Bounty

7 Replies

chandlergims
HOBBYOP

9 months ago

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


chandlergims
HOBBYOP

9 months 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

9 months ago

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


chandlergims
HOBBYOP

9 months ago

1383611936490651600


chandlergims
HOBBYOP

9 months ago

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


9 months 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

8 months 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"


Loading...