views:

13

answers:

0

Hello!

I'm trying to delete all snapshots except the X newest ones on a Windows AWS instance via the EC2 commandline API tools. I've found the following for Linux... Is it possible to do the same in Windows?

ec2-describe-snapshots | sort -r -k 5 | sed 1,6d | awk '{print "Deleting snapshot: " $2}; system("ec2-delete-snapshot " $2)'