Created
November 2, 2017 16:34
-
-
Save mikejk8s/1034b8775f6e65af6f5963b256ba089d to your computer and use it in GitHub Desktop.
Google Compute Snapshotter
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# loop through all disks within this project and create a snapshot | |
gcloud compute disks list --format='value(name,zone)'| while read DISK_NAME ZONE; do | |
gcloud compute disks snapshot $DISK_NAME --snapshot-names gcs-$DISK_NAME-$(date "+%Y-%m-%d-%s") --zone $ZONE | |
done | |
# |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment