Skip to content

Automated creation of google compute disk snapshots and deletion of old ones

Notifications You must be signed in to change notification settings

jamesonp/google-compute-snapshot

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 

Repository files navigation

Google Compute Engine Snapshot

Overview

  • Takes daily snapshot of primary disk without any user input
  • Deletes all snapshots that are older than 7 days

Prerequisite

  • cURL must be installed

Limitations

  • Only works for the primary disk on VM

Setup

  • I run the script from cron.d: 0 05 * * * root sh /1/snapshot.sh >> /var/log/cron/snapshot.log 2>&1
  • I created the var/log/cron directory for all of my cron outputs
  • I added the var/log/cron directory folder to logrotate: /etc/logrotate.d/cron
     daily
     missingok
     rotate 14
     compress
     notifempty
     create 640 root adm
     sharedscripts
 }```
 
## Downloading the script and opening in Windows?
 * If you download the script and open it on a Windows machine, that may add windows character's to the file: https://github.com/Forward-Action/google-compute-snapshot/issues/1.

About

Automated creation of google compute disk snapshots and deletion of old ones

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 100.0%