How to set a CRON job into my project

AnonymousTRIAL

a year ago

Hi, I'm trying to understand how to set a CRON job into my project. After read documentation I didn't see how to do it.

I have a Astro project deployed and now I would like to create a CRON job to create the sitemap once a day.

The command it should run is npm run build:sitemaps

Thanks

0 Replies

AnonymousTRIAL

a year ago

433694d4-8b7c-4582-84e2-6a75a2bbaf19


AnonymousTRIAL

a year ago

I want to do railway cron


AnonymousTRIAL

a year ago

Should I updated the railway.json?

{
  "$schema": "https://railway.app/railway.schema.json",
  "build": {
    "builder": "NIXPACKS"
  },
  "deploy": {
    "numReplicas": 1,
    "sleepApplication": false,
    "restartPolicyType": "ON_FAILURE",
    "restartPolicyMaxRetries": 10
  }
}

a year ago

cron jobs would be enabled via the service settings, but before you do that, lets talk about what you expect out of the cron job.

I have a Astro project deployed and now I would like to create a CRON job to create the sitemap once a day.
your cron service would be a separate railway service and would not run in the context of your astro service, so im not sure how you are going to pass the file to your astro site, please tell me how you plan to implement this


How to set a CRON job into my project - Railway Help Station