How to set a CRON job into my project
Anonymous
TRIALOP

2 years 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

4 Replies

Anonymous
TRIALOP

2 years ago

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


Anonymous
TRIALOP

2 years ago

I want to do railway cron


Anonymous
TRIALOP

2 years 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
  }
}

2 years 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


Loading...