backup_aws_s3 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +11 -17
- data/lib/backup_aws_s3.rb +2 -2
- data/lib/backup_aws_s3/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 82b6f806ecd5aeeb60c4b9b735cf7dafdf3718ec
|
4
|
+
data.tar.gz: 51c55f4aa36e914397ad2bc6ffdd41dcc81b0ee9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ccb8bb8d6435c4ca5e3d9ebd93141e3442a3f5630f37876033ee8598eaa9e0f581578570b17bd70697285db1f5da54ea9d1de90b3d367c4632b6edd34008d556
|
7
|
+
data.tar.gz: 6df33f433e023cf1221958f20cc731f67e927355a82dc987acba33e66ee0e7edee7c4b46ff8cc72e6ca19d61f91d7844d84660648972b04184c7bf08b6c8a3e8
|
data/README.md
CHANGED
@@ -4,18 +4,6 @@ Backup s3 folders to another s3
|
|
4
4
|
|
5
5
|
## Installation
|
6
6
|
|
7
|
-
Add this line to your application's Gemfile:
|
8
|
-
|
9
|
-
```ruby
|
10
|
-
gem 'backup_aws_s3'
|
11
|
-
```
|
12
|
-
|
13
|
-
And then execute:
|
14
|
-
|
15
|
-
$ bundle
|
16
|
-
|
17
|
-
Or install it yourself as:
|
18
|
-
|
19
7
|
$ gem install backup_aws_s3
|
20
8
|
|
21
9
|
## Pre-Requisites Installss
|
@@ -36,7 +24,7 @@ Insert you aws keys
|
|
36
24
|
$ sudo touch /var/log/s3s3mirror.log
|
37
25
|
$ sudo chmod 777 /var/log/s3s3mirror.log
|
38
26
|
|
39
|
-
## Create Enviroment Variables in /etc/
|
27
|
+
## Create Enviroment Variables in /etc/enviroment
|
40
28
|
|
41
29
|
export S3_BUCKET_BACKUP="xxxxxxxxxxx"
|
42
30
|
export S3_ACCESS_KEY_ID="xxxxxxxxxxx"
|
@@ -45,14 +33,20 @@ Insert you aws keys
|
|
45
33
|
|
46
34
|
## Usage
|
47
35
|
|
48
|
-
$
|
36
|
+
$ backup_aws_s3 identification_name source dest keep
|
49
37
|
|
50
|
-
|
38
|
+
|
39
|
+
Explain
|
40
|
+
|
41
|
+
identification_name: app name and behaviour of backup
|
42
|
+
source: bucket_name/folder/subfolder...
|
43
|
+
dest: bucket_name/folder/subfolder...
|
44
|
+
keep: amount of backups needs to keep
|
51
45
|
|
52
46
|
### Example
|
53
47
|
|
54
|
-
$
|
55
|
-
$
|
48
|
+
$ backup_aws_s3 "app1_last_30_days" "scproduction/" "${S3_BUCKET_BACKUP}/upload_files/app1/$(date +%Y.%m.%d.%H.%M.%S)/" 30
|
49
|
+
$ backup_aws_s3 "app1_20_in_20_minuts" "scproduction/" "${S3_BUCKET_BACKUP}/upload_files/erp/$(date +%Y.%m.%d.%H.%M.%S)/" 216
|
56
50
|
|
57
51
|
## Feel free to put commands above in crontab
|
58
52
|
|
data/lib/backup_aws_s3.rb
CHANGED
@@ -19,12 +19,12 @@ class BackupS3
|
|
19
19
|
dest = opt[:dest]
|
20
20
|
source = opt[:source]
|
21
21
|
keep = opt[:keep]
|
22
|
-
fail 'Missing any of these parameters: name, dest, source or keep' unless name && dest && source
|
22
|
+
fail 'Missing any of these parameters: name, dest, source or keep' unless name && dest && source
|
23
23
|
p "Creating backup: #{name} in #{dest} "
|
24
24
|
Open3.popen3('nroff -man') do |stdin, stdout, stderr|
|
25
25
|
system "cd #{ENV['S3S3MIRROR_PATH']} && ./s3s3mirror.sh #{source} #{dest}"
|
26
26
|
p "Created backup: #{name} in #{dest} "
|
27
|
-
BackupS3::Cycler.new(name).cycle!(path: dest, keep: keep)
|
27
|
+
BackupS3::Cycler.new(name).cycle!(path: dest, keep: keep) if keep
|
28
28
|
end
|
29
29
|
end
|
30
30
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: backup_aws_s3
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rodrigo Mendonca
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-07-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: manage_s3_bucket
|