@@ -6,11 +6,11 @@ export PATH=$PATH:/usr/local/bin/:/usr/bin
6
6
set -ue
7
7
set -o pipefail
8
8
9
-
10
9
# # Automatic EBS Volume Snapshot Creation & Clean-Up Script
11
10
#
12
11
# Written by Casey Labs Inc. (https://www.caseylabs.com)
13
- # Casey Labs - Contact us for all your Amazon Web Services Consulting needs!
12
+ # Contact us for all your Amazon Web Services Consulting needs!
13
+ # Script Github repo: https://github.com/CaseyLabs/aws-ec2-ebs-automatic-snapshot-bash
14
14
#
15
15
# Additonal credits: Log function by Alan Franzoni; Pre-req check by Colin Johnson
16
16
#
@@ -20,75 +20,11 @@ set -o pipefail
20
20
# - Take a snapshot of each attached volume
21
21
# - The script will then delete all associated snapshots taken by the script that are older than 7 days
22
22
#
23
- # DISCLAIMER: Hey, this script deletes snapshots (though only the ones that it creates)!
24
- # Make sure that you undestand how the script works. No responsibility accepted in event of accidental data loss.
23
+ # DISCLAIMER: This script deletes snapshots (though only the ones that it creates).
24
+ # Make sure that you understand how the script works. No responsibility accepted in event of accidental data loss.
25
25
#
26
26
27
27
28
- # # Requirements ##
29
-
30
- # # 1) IAM USER:
31
- #
32
- # This script requires that a new IAM user be created in the IAM section of AWS.
33
- # Here is a sample IAM policy for AWS permissions that this new user will require:
34
- #
35
- # {
36
- # "Version": "2012-10-17",
37
- # "Statement": [
38
- # {
39
- # "Sid": "Stmt1426256275000",
40
- # "Effect": "Allow",
41
- # "Action": [
42
- # "ec2:CreateSnapshot",
43
- # "ec2:CreateTags",
44
- # "ec2:DeleteSnapshot",
45
- # "ec2:DescribeSnapshotAttribute",
46
- # "ec2:DescribeSnapshots",
47
- # "ec2:DescribeVolumeAttribute",
48
- # "ec2:DescribeVolumes"
49
- # ],
50
- # "Resource": [
51
- # "*"
52
- # ]
53
- # }
54
- # ]
55
- # }
56
-
57
-
58
- # # 2) AWS CLI:
59
- #
60
- # This script requires the AWS CLI tools to be installed.
61
- # Read more about AWS CLI at: https://aws.amazon.com/cli/
62
- #
63
- # Linux install instructions for AWS CLI:
64
- # ASSUMPTION: these commands are ran as the ROOT user.
65
- #
66
- # - Install Python pip (e.g. yum install python-pip or apt-get install python-pip)
67
- # - Then run: pip install awscli
68
- #
69
- # Configure AWS CLI by running this command:
70
- # aws configure
71
- #
72
- # [NOTE: if you have an IAM Role Setup for your instance to use the IAM policy listed above, you can skip the aws configure step.]
73
- #
74
- # Access Key & Secret Access Key: enter in the credentials generated above for the new IAM user
75
- # Region Name: the region that this instance is currently in (e.g. us-east-1, us-west-1, etc)
76
- # Output Format: enter "text"
77
-
78
-
79
- # # 3) SCRIPT INSTALLATION:
80
- #
81
- # Copy this script to /opt/aws/ebs-snapshot.sh
82
- # And make it exectuable: chmod +x /opt/aws/ebs-snapshot.sh
83
- #
84
- # Then setup a crontab job for nightly backups:
85
- # (You will have to specify the location of the AWS CLI Config file)
86
- #
87
- # AWS_CONFIG_FILE="/root/.aws/config"
88
- # 00 06 * * * root /opt/aws/ebs-snapshot.sh
89
-
90
-
91
-
92
28
# # Variable Declartions ##
93
29
94
30
# Get Instance Details
0 commit comments