- Takes daily snapshot of primary disk without any user input
- Deletes all snapshots that are older than 30 days
- cURL must be installed
- The VM must have the sufficient gcloud permissions. e.g. roles/compute.storageAdmin
- I run the script from cron.d:
0 * * * * root sh /snapshot.sh
- If you download the script and open it on a Windows machine, that may add windows character's to the file: jacksegal#1.