Skip to content

Latest commit

 

History

History
29 lines (23 loc) · 899 Bytes

README.md

File metadata and controls

29 lines (23 loc) · 899 Bytes

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.