Skip to content

Shell script for backup ec2 with ami and cross region replica

Notifications You must be signed in to change notification settings

antoweb/aws-ec2-ami-backup-replica

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 

Repository files navigation

PAYPAL DONTAION
paypal

aws-ec2-ami-backup-replica (script aws-ec2-ami-backup-replica.sh)

Shell script for backup ec2 with ami and cross region replica fork from https://github.com/pavlops/aws-ami-backups

This script starts from the script of https://github.com/pavlops/aws-ami-backups but has been improved in these points:

  1. Removed the InstanceId parameter and the Identifier parameter

  2. Backs up all hooks in running state and those in stopped state with the tag backup_if_stopped = True

  3. Create a replica in eu-central-1 (or you must change line 111)

Requirements:

  1. Ec2 must be in eu-west-1 or you have to change the line 111 Ec2 source region can be setup in variable $sourceregion
  2. Replica is in eu-central-1 (or you must change line 111) Ora change variable $destregion
  3. The server from which it is launched must have the aws profile configured
  4. Aws cli

Usage:

 ./aws-ec2-ami-backup-replica.sh retentiondays profile 

A future version will also support the region

UPDATE 09/06/2021

  • Added support for choosing regions in variable
  • Added search for instances with tag value backup_if_stopped True or true
  • Added deleting old images from destination region

aws-ec2-ami-backup-REGION-replica (script aws-ec2-ami-backup-REGION-replica.sh)

SCRIPT aws-ec2-ami-backup-REGION-replica.sh

Same as before script but with possibility to choose source and destination region in parameter ($3 and $4)

About

Shell script for backup ec2 with ami and cross region replica

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages