This is a simple service to upload the backup of postgresql database to a Supabase Bucket.
Make a sure you set the env
vars before continue
This command doing all the steps necessary to run the service inside Docker containers:
make
This command doing all the steps necessary to run the service inside Docker containers in a remote server:
make -f Makefile-remote
At this point, the backup service generate a SQL
file with the backup of the database.
cat dump.sql | docker exec -i CONTAINER_NAME_OR_ID psql -U postgres -d tavivo
Here I am going to assume that you have crontab installed.
1 - Add your job crontab -e
;
Run this with a crontab to make a backup every day at 3am
0 3 * * * cd /var/www/services/ta-vivo-backup-uploader && make >/dev/null 2>&1
or for remote server
0 3 * * * cd /var/www/services/ta-vivo-backup-uploader && make -f Makefile-remote >/dev/null 2>&1
2 - Check if your job is running crontab -l
;
You can add /tmp/stderr.log
on the end of the line instead of &1
like;
0 3 * * * cd /var/www/services/ta-vivo-backup-uploader && make -f Makefile-remote >/dev/null 2>/tmp/stderr.log
This is all! ❤️