backup_aws_s3 0.0.3 → 0.0.4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8177273ed5ffb90d102b67f275f12cba9722f9c7
4
- data.tar.gz: 1a0d680c9ce6c84e8f5da47736c8774ca9ac9098
3
+ metadata.gz: 9746a78e10081f8f6729374e4797e3485b8d6a31
4
+ data.tar.gz: 6c2c09ec0fe55d9eac63f23814f87046c06bcec0
5
5
  SHA512:
6
- metadata.gz: e43da6a151e760c9f5f7e6d987dff65c758e793e37ffe1d000ae8835a88ec41049663b8efd3a5bca24b505922641aaa4d7c0a13e7d632b95f27c12c3f4ea3aa7
7
- data.tar.gz: 44aedeb0e291604f1b853a8f633903fd298253b18f59d51f8236e87f5fb7ad8dbc2553219019288f2b38307e25b7b2012f4069f113770fa13a84f8a1fb8bd409
6
+ metadata.gz: dff4c4498436320e91d8cc8605d2306f06550f2f36e72f792550d0084acdbb5bc7a5bf6e82ef0173b7829a416f2bfb6511df8b30903933c3b2fc871d3f8bc2b5
7
+ data.tar.gz: 35181ee0f6d0d08d8945b4432f7fd42f494bc1de69a20fc2367a4cb3e718327cc3cb5f9f53e4645554e6a331e61bc567dcd05f82c81f9dda171eccd4ab1782e4
@@ -1,5 +1,9 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
3
  require 'backup_aws_s3'
4
- # puts Hola.hi(ARGV[0])
5
- puts "aaaaaaaaaaaaaaaaaaaaaaaaa"
4
+ BackupS3.new(
5
+ name: ARGV[0],
6
+ source: ARGV[1],
7
+ dest: ARGV[2],
8
+ keep: ARGV[3]
9
+ )
@@ -8,17 +8,23 @@ require 'yaml'
8
8
  # no docs
9
9
  class BackupS3
10
10
  def initialize(opt = {})
11
+ unless ENV['S3S3MIRROR_PATH'] && ENV['S3_ACCESS_KEY_ID'] && ENV['S3_SECRET_KEY_ID']
12
+ fail 'Not found any of these enviroment variables: S3_ACCESS_KEY_ID, S3_SECRET_KEY_ID, S3S3MIRROR_PATH'
13
+ end
11
14
  create opt
12
15
  end
13
16
 
14
17
  def create(opt = {})
15
- name = opt[:name]
16
- dest = opt[:dest]
18
+ name = opt[:name]
19
+ dest = opt[:dest]
20
+ source = opt[:source]
21
+ keep = opt[:keep]
22
+ fail 'Missing any of these parameters: name, dest, source or keep' unless name && dest && source && keep
17
23
  p "Creating backup: #{name} in #{dest} "
18
24
  Open3.popen3('nroff -man') do |stdin, stdout, stderr|
19
- # system "cd #{ENV['S3S3MIRROR_PATH']} && ./s3s3mirror.sh #{opt[:source]} #{dest}"
20
- # p "Created backup: #{name} in #{dest} "
21
- BackupS3::Cycler.new(name).cycle!(path: dest, keep: opt[:keep])
25
+ # system "cd #{ENV['S3S3MIRROR_PATH']} && ./s3s3mirror.sh #{source} #{dest}"
26
+ p "Created backup: #{name} in #{dest} "
27
+ BackupS3::Cycler.new(name).cycle!(path: dest, keep: keep)
22
28
  end
23
29
  end
24
30
 
@@ -56,7 +62,7 @@ class BackupS3
56
62
  # Returns path to the YAML data file.
57
63
  def yaml_file
58
64
  @yaml_file ||= begin
59
- File.join('.data', 'last_s3_backups', "#{ @name }.yml")
65
+ File.join('~/.backup_aws_s3', 'last_s3_backups', "#{ @name }.yml")
60
66
  end
61
67
  end
62
68
 
@@ -79,10 +85,3 @@ class BackupS3
79
85
  end
80
86
  end
81
87
  end
82
-
83
- BackupS3.new(
84
- name: ARGV[0],
85
- source: ARGV[1],
86
- dest: ARGV[2],
87
- keep: ARGV[3]
88
- )
@@ -1,3 +1,3 @@
1
1
  module BackupAwsS3
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: backup_aws_s3
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rodrigo Mendonca