- Takes daily snapshot of primary disk without any user input
- Deletes all snapshots that are older than 7 days
- cURL must be installed
- Only works for the primary disk on VM
- 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.