Backup Redis data with shell command and Cloud Run - MRLIVING/Becca GitHub Wiki
TOC
Overview
Exporting data from Redis
gcloud redis instances export gs://${bucketName}/${redis_id}_$(date +%FT%H%M%S).rdb ${redis_id} --region=asia-east1 --project=${proj_id}
Cloud Run
Execute the Redis Exporting command viaDocker Quick Start
Cloud SDK image
- google/cloud-sdk:latest
docker pull google/cloud-sdk:latest
Dockerfile
- Help to build a docker image and run the export command during container start
- export_redis_job/
Build and Submit the job docker image
- Build a docker image and submit it to container registry, gcr.io
- gcloud builds submit
gcloud builds submit -t "gcr.io/${project_id}/backup/export_redis-pay_job"
- gcloud builds submit