How to set a CRON job into my project

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
3 Replies
Percy
Percy9mo ago
Project ID: 433694d4-8b7c-4582-84e2-6a75a2bbaf19
Oscar Bustos
Oscar BustosOP9mo ago
433694d4-8b7c-4582-84e2-6a75a2bbaf19 I want to do railway cron 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
}
}
{
"$schema": "https://railway.app/railway.schema.json",
"build": {
"builder": "NIXPACKS"
},
"deploy": {
"numReplicas": 1,
"sleepApplication": false,
"restartPolicyType": "ON_FAILURE",
"restartPolicyMaxRetries": 10
}
}
Brody
Brody9mo 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
Want results from more Discord servers?
Add your server