Open bkrodgers opened 9 years ago
For 5., there is value in many cases in using the hostname, so I think it should probably stay, but do like the idea of having the instance ID in there, so maybe a compromise would be to have both? Something like:
snapshot_description="$(hostname)-$instance_id-$device_name-backup-$(date +%Y-%m-%d)"
It's a little long, but gives a pretty comprehensive summary of what the particular snapshot represents. Another option would be to add it as a tag to the snapshot, rather than the description.
OK, I just pushed an option that checks if you're running inside docker (docker containers get a /.dockerinit file mounted inside them). If inside docker, it'll leave the hostname out, otherwise it includes it along with the instance id.
I also added two tags "CreatedFromInstance" and "InstanceDevice" to the snapshot, to make it a bit easier to search by those if needed. We could add a hostname tag as well if you think that's valuable.
Hi, great work on your script! I made a few changes I'd like to submit back to you.
Let me know if there's anything you'd like me to change!