Update 'Backing up stuff in Google Cloud Storage'

Guillem Borrell Nogueras 2022-08-07 11:20:22 +02:00
parent 7fd47ee20d
commit c4180c0293

@ -2,7 +2,7 @@
Once you have a subscription, these are the steps: Once you have a subscription, these are the steps:
1. Create a bucket in Google Cloud Storage 1. Create a bucket in Google Cloud Storage. It's better if it's not a public bucket
2. Create a service account in IAM & Admin of the subscription 2. Create a service account in IAM & Admin of the subscription
3. When creating the account, there's an option to add a role. This role has to be "Storage object Admin". If that has ever to be edited, it has to be edited in the initial IAM page, together with the other principals. 3. When creating the account, there's an option to add a role. This role has to be "Storage object Admin". If that has ever to be edited, it has to be edited in the initial IAM page, together with the other principals.
4. Create a json file for the key of that service account, in the specific menu for service accounts, where the account was created. 4. Create a json file for the key of that service account, in the specific menu for service accounts, where the account was created.
@ -10,7 +10,8 @@ Once you have a subscription, these are the steps:
6. Authenticate the google cloud command with the service principal (`gcloud auth activate-service-account --key-file=[KEY_FILE] 6. Authenticate the google cloud command with the service principal (`gcloud auth activate-service-account --key-file=[KEY_FILE]
`) `)
7. Use the gcloud command to copy the local file to the bucket (`gcloud alpha storage cp /var/backups/cluster.sql gs://lab-backup-gbn/`). You may do it for the users root and postgres, so that they can also back up files. 7. Use the gcloud command to copy the local file to the bucket (`gcloud alpha storage cp /var/backups/cluster.sql gs://lab-backup-gbn/`). You may do it for the users root and postgres, so that they can also back up files.
8. Create and activate the following units and timers in systemd 8. Copy the following files in the folder `/etc/systemd/system`
8. Run `systemctl daemon-reload`, enable, and start the timers in systemd
# Files # Files