Skip to content

Instantly share code, notes, and snippets.

@Thaina
Created August 10, 2023 13:05
Show Gist options
  • Save Thaina/8a17f29a13f4fef3b852de43abb67e7d to your computer and use it in GitHub Desktop.
Save Thaina/8a17f29a13f4fef3b852de43abb67e7d to your computer and use it in GitHub Desktop.
gcloud backup all disk to images
for data in $(gcloud compute disks list --format="csv[no-heading](NAME,LOCATION)"); do $(gcloud compute images create ${data%%,*} --source-disk="${data%%,*}" --source-disk-zone="${data#*,}" --storage-location=asia-southeast1); done;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment