AWS EC2 | How to automate the Snapshot command

|
| By Webner

You can create snapshots of the EBS volume which can help to restore to a prior state in future if required. Better is you can create a bash script and put the commands for taking snapshot in it and then put the script in task scheduler to run at specific time intervals to do it automatically.

Command example :

aws ec2-create-snapshot --volume-id vol-698xxx --description "Daily Backup - hostname-01 /dev/sda1"

aws ec2-create-snapshot --volume-id vol-e998xxx --description "Daily Backup - hostname-01 /dev/sda1"

Note : Replace vol-xxxxxx ID according to volume name which you can get from AWS console from volumes menu and replace the description including hostname mentioned in quotes according to your requirements.

Webner Solutions is a Software Development company focused on developing CRM apps (Salesforce, Zoho), LMS Apps (Moodle/Totara), Websites and Mobile apps. If you need any software development assistance please contact us at dev@webners.com

Leave a Reply

Your email address will not be published. Required fields are marked *