R
Railway7mo ago
AraGon

cloudflare R2 postgres backups with cron

hey , i have found this great template https://github.com/railwayapp-templates/postgres-s3-backups it looks like it does the job , but i would like to know if there is any version of this template that uses railway built in corn job so it will run the server based on some corn ( 7days or so )
GitHub
GitHub - railwayapp-templates/postgres-s3-backups: A simple Node ap...
A simple Node app to automatically backup PostgreSQL databases to an S3 bucket - railwayapp-templates/postgres-s3-backups
Solution:
that template actually does have support for railway's native cron, simply enable your desired cron expression in the service settings, then set a SINGLE_SHOT_MODE service variable to true this will cause the app to instantly start the backend when ran and then exit when it's done it's backup allowing you to use it with railways native cron!
Jump to solution
11 Replies
Percy
Percy7mo ago
Project ID: N/A
AraGon
AraGonOP7mo ago
N/A
Solution
Brody
Brody7mo ago
that template actually does have support for railway's native cron, simply enable your desired cron expression in the service settings, then set a SINGLE_SHOT_MODE service variable to true this will cause the app to instantly start the backend when ran and then exit when it's done it's backup allowing you to use it with railways native cron!
AraGon
AraGonOP7mo ago
great stuff! , thank you
Brody
Brody7mo ago
let me know if it works for you!
AraGon
AraGonOP7mo ago
hey @Brody 1 - for the region should i enter WEUR for : Western Europe (WEUR) 2 - for the endpoint should i enter the S3 API when using r2 ? thats what i understand
Brody
Brody7mo ago
for the region you should use auto and for the endpoint, you use the endpoint that cloudflare gave you
AraGon
AraGonOP7mo ago
should i sleep for the prv db ?
Brody
Brody7mo ago
no, it handles that itself it uses pg_isready instead
AraGon
AraGonOP7mo ago
works great with no effort ! thanks brody
Brody
Brody7mo ago
awesome! I'll update those variable descriptions to include info on what to use if using cloudflare r2
Want results from more Discord servers?
Add your server