How can I periodically run a management command on railway?

I need to cd into the project's folder, and then run
python manage.py recurpayments
python manage.py recurpayments
, but i can't seem to figure out how to do this (the only option that there seems to be is running a start command on a cron schedule) Thanks!
11 Replies
Percy
Percy8mo ago
Project ID: 6ec4e69f-153c-42b1-8399-d4fbd6db04fb
meaniebeanie22
meaniebeanie228mo ago
probably irrelevant but 6ec4e69f-153c-42b1-8399-d4fbd6db04fb
Brody
Brody8mo ago
create a new service in the project, add the needed service variables, set that as the start command, set the cron schedule, and then add your repo
meaniebeanie22
meaniebeanie228mo ago
are all my services run inside something like one VM, and as such i can set the start command to something like
cd tkdmanager && python manage.py recurpayments
cd tkdmanager && python manage.py recurpayments
? or maybe is there a way for me to view the file structure of the vm through a service?
Brody
Brody8mo ago
nope, if you want the command to be run in the tkdmanager sub directory set the root directory of tbr service to /tkdmanager
meaniebeanie22
meaniebeanie228mo ago
and that will be the same /tkdmanager as the django service?
Brody
Brody8mo ago
the same code yes, the same disk, no
meaniebeanie22
meaniebeanie228mo ago
ARGHHHH okay so i have my django service that needs a command run based on a cron schedule i make a new blank service this service has its root directory set to /tkdmanager set the start command of the new service to be
python manage.py recurpayments
python manage.py recurpayments
and then set that to run on the cron schedule ?
Brody
Brody8mo ago
sounds correct
meaniebeanie22
meaniebeanie228mo ago
okay will try that doesn't seem to do anything i added a print to the start of the command and that isn't firing either
Brody
Brody8mo ago
you'd have some other config / code issues then
Want results from more Discord servers?
Add your server