Merge lp:~mnjul/duplicity/s3-infreq-access into lp:duplicity/0.7-series

Proposed by Min-Zhong "John" Lu on 2015-10-10
Status: Merged
Merged at revision: 1131
Proposed branch: lp:~mnjul/duplicity/s3-infreq-access
Merge into: lp:duplicity/0.7-series
Diff against target: 67 lines (+18/-0)
4 files modified
bin/duplicity.1 (+8/-0)
duplicity/backends/_boto_single.py (+2/-0)
duplicity/commandline.py (+5/-0)
duplicity/globals.py (+3/-0)
To merge this branch: bzr merge lp:~mnjul/duplicity/s3-infreq-access
Reviewer Review Type Date Requested Status
duplicity-team 2015-10-10 Pending
Review via email: mp+274037@code.launchpad.net

Description of the change

This adds support for AWS S3's newly announced Infrequent Access storage class and is intended to implement Blueprint: https://blueprints.launchpad.net/duplicity/+spec/aws-s3-std-ia-class .

A new command line option, --s3-use-ia, is added, and boto backend will automatically use the correct storage class value depending on whether --s3-use-rrs and --s3-use-ia is set. Command line parser will prompt error if both --s3-use-ia and --s3-use-rrs are used together, as they conflict with each other.

The manpage has been updated giving a short explanation on the new option. Its wording derives from Amazon's official announcement: https://aws.amazon.com/about-aws/whats-new/2015/09/announcing-new-amazon-s3-storage-class-and-lower-glacier-prices/

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bin/duplicity.1'
2--- bin/duplicity.1 2015-09-10 11:49:10 +0000
3+++ bin/duplicity.1 2015-10-10 00:28:16 +0000
4@@ -726,6 +726,14 @@
5 Storage on S3.
6
7 .TP
8+.BI "--s3-use-ia"
9+Store volumes using Standard - Infrequent Access when uploading to Amazon S3.
10+This storage class has a lower storage cost but a higher per-request cost, and
11+the storage cost is calculated against a 30-day storage minimum. According to
12+Amazon, this storage is ideal for long-term file storage, backups, and disaster
13+recovery.
14+
15+.TP
16 .BI "--s3-use-multiprocessing"
17 Allow multipart volumne uploads to S3 through multiprocessing. This option
18 requires Python 2.6 and can be used to make uploads to S3 more efficient.
19
20=== modified file 'duplicity/backends/_boto_single.py'
21--- duplicity/backends/_boto_single.py 2015-08-04 13:19:29 +0000
22+++ duplicity/backends/_boto_single.py 2015-10-10 00:28:16 +0000
23@@ -221,6 +221,8 @@
24
25 if globals.s3_use_rrs:
26 storage_class = 'REDUCED_REDUNDANCY'
27+ elif globals.s3_use_ia:
28+ storage_class = 'STANDARD_IA'
29 else:
30 storage_class = 'STANDARD'
31 log.Info("Uploading %s/%s to %s Storage" % (self.straight_url, remote_filename, storage_class))
32
33=== modified file 'duplicity/commandline.py'
34--- duplicity/commandline.py 2015-06-21 14:53:05 +0000
35+++ duplicity/commandline.py 2015-10-10 00:28:16 +0000
36@@ -523,6 +523,9 @@
37 # Whether to use S3 Reduced Redudancy Storage
38 parser.add_option("--s3-use-rrs", action="store_true")
39
40+ # Whether to use S3 Infrequent Access Storage
41+ parser.add_option("--s3-use-ia", action="store_true")
42+
43 # Whether to use "new-style" subdomain addressing for S3 buckets. Such
44 # use is not backwards-compatible with upper-case buckets, or buckets
45 # that are otherwise not expressable in a valid hostname.
46@@ -1057,6 +1060,8 @@
47 if globals.restore_dir:
48 command_line_error("restore option incompatible with %s backup"
49 % (action,))
50+ if globals.s3_use_rrs and globals.s3_use_ia:
51+ command_line_error("--s3-use-rrs and --s3-use-ia cannot be used together")
52
53
54 def ProcessCommandLine(cmdline_list):
55
56=== modified file 'duplicity/globals.py'
57--- duplicity/globals.py 2015-06-21 14:53:05 +0000
58+++ duplicity/globals.py 2015-10-10 00:28:16 +0000
59@@ -191,6 +191,9 @@
60 # Whether to use S3 Reduced Redudancy Storage
61 s3_use_rrs = False
62
63+# Whether to use S3 Infrequent Access Storage
64+s3_use_ia = False
65+
66 # True if we should use boto multiprocessing version
67 s3_use_multiprocessing = False
68

Subscribers

People subscribed via source and target branches