Skip to content

Instantly share code, notes, and snippets.

View bmatthewshea's full-sized avatar

Brady Shea bmatthewshea

View GitHub Profile
@bmatthewshea
bmatthewshea / windows_ec2_snapshot.bat
Last active September 13, 2016 21:09 — forked from ehlertij/windows_ec2_snapshot.bat
Windows batch script for creating daily EC2 snapshots for a volume and deleting old ones.
set AWS_EC2_COMMAND=aws ec2 --dryrun
set AWS_HOME=.
set AWS_VOLUME=vol-12345678
set AWS_SNAPSHOT_KEEP=10
set VOL_DESC=Daily Snapshot
:: Create snapshot for this volume
CMD /C %AWS_EC2_COMMAND% create-snapshot %AWS_VOLUME% -d "%VOL_DESC%"
:: Find old snapshots for this volume, sort them by date desc