Schedule Python code using Cron
I want to deploy my python code as an api, but also would like to schedule some cron jobs to run python scripts. What am I doing wrong? this is my railway json file:
{
"$schema": "https://railway.app/railway.schema.json",
"build": {
"builder": "NIXPACKS"
},
"deploy": {
"startCommand": "python application.py",
"restartPolicyType": "ON_FAILURE",
"restartPolicyMaxRetries": 10
},
"cron": {
"job": "0 0 * ? * ",
"command": "python zera_consultas.py"
},
"cron": {
"job": "0 0 ? * *",
"command": "python desbloqueia_usuarios.py"
}
}
3 Replies