s3log 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b1e1cf5759832d0b418f7a87e503e22ad6abc6c2
4
- data.tar.gz: d7e95c7249c91bfd6b868f7b35d13fb6cf50f2fe
3
+ metadata.gz: 0bde1aff2eb20a032be6705f2a5c9d47ad593799
4
+ data.tar.gz: 17b2ca8475e553f3b606099bcb9b086e5fc2c21f
5
5
  SHA512:
6
- metadata.gz: f995e5e3fab29e773f7480a52241e9f1a448c08e2ca4b06c63529235d4e1c5f8d558ba7351238554483ce945ed50699e26cc0ca82f7a4f483948b85fd04389de
7
- data.tar.gz: 0817870abf853d6f3d80558514c3931b10d0a555c7df7380553ba5b8767a6b469785041278c6c016789ff14e6ffc837d73c09c86fb1564d8640ffcd8b966f431
6
+ metadata.gz: 8bff5484f38ae6359d3de85a5bdcd30c0f97cfba05eaec88a50a993b63d46fd1ed76a9bfb00ddb2ecac2b1a949810ce983ced8c66d439959b411de71a1d5fa65
7
+ data.tar.gz: 8d2ab0819d3f059dd29c318f6454df4da1fb4d3cd019cfb9835287c313f226c70470e979c2f119f0a799772b924ff1e6f805887aebf10cab09af703e26d2c46a
data/CHANGELOG.md CHANGED
@@ -1,6 +1,11 @@
1
1
  S3log Changelog
2
2
  -------------------
3
3
 
4
+ ### v0.0.4 - 2014-01-15
5
+
6
+ * fix cron line for jobs when config file is specified on commandline
7
+ * add jobname in log when same s3log is used with different configs
8
+
4
9
  ### v0.0.3 - 2014-01-15
5
10
 
6
11
  * refix on crontab scheduling for good this time
data/README.md CHANGED
@@ -11,7 +11,7 @@ S3log script is intended to transform this logging in a unified logfile wherever
11
11
 
12
12
  It's designed to run on debian/ubuntu servers but should work on any linux server, and it also work on mac osx. It works with ruby 1.9 and 2.0 (but not 1.8).
13
13
 
14
- (work in progress, not ready for use yet).
14
+ (work in progress, not ready for use yet, check the [Changelog](CHANGELOG.md)).
15
15
 
16
16
  ## Installation
17
17
 
data/lib/s3log/cron.rb CHANGED
@@ -4,7 +4,7 @@ module S3log
4
4
  def initialize(configfile)
5
5
  @configfile = configfile
6
6
  @config = YAML::load_file(configfile)
7
- @path = File.dirname(configfile)
7
+ @path = File.dirname(File.expand_path(configfile))
8
8
  @jobname = @config['jobname']
9
9
  @schedule = @config['schedule']
10
10
  @logdir = @config['logdir']
@@ -27,9 +27,9 @@ module S3log
27
27
  tmp_cron_file << "# S3log job #{@jobname}\n#{line}" unless included
28
28
  tmp_cron_file.fsync
29
29
  if system("crontab #{tmp_cron_file.path}")
30
- S3log::Log.info "[update] crontab updated."
30
+ S3log::Log.info "#{@jobname} [update] crontab updated."
31
31
  else
32
- S3log::Log.warn "[fail] Couldn't write crontab."
32
+ S3log::Log.warn "#{@jobname} [fail] Couldn't write crontab."
33
33
  tmp_cron_file.close!
34
34
  exit(1)
35
35
  end
data/lib/s3log/runner.rb CHANGED
@@ -12,6 +12,7 @@ module S3log
12
12
  )
13
13
  @bucket = @s3.buckets[@config['bucket']]
14
14
  @prefix = @config['prefix']
15
+ @jobname = @config['jobname']
15
16
  @logdir = @config['logdir']
16
17
  FileUtils.mkdir(@logdir) unless Dir.exists? @logdir
17
18
  S3log::Log.set_logger(File.join(@logdir, 's3log.log'), @config['loglevel'])
@@ -30,7 +31,7 @@ module S3log
30
31
  def download
31
32
  if items.size > 0
32
33
  time = Time.now
33
- S3log::Log.info "Downloading #{items.size} file."
34
+ S3log::Log.info "#{@jobname} Downloading #{items.size} file."
34
35
  File.open(@config['outputfile'], 'a+') do |f|
35
36
  items.each do |i|
36
37
  f.puts @bucket.objects[i].read
@@ -38,7 +39,7 @@ module S3log
38
39
  @bucket.objects[i].delete
39
40
  end
40
41
  end
41
- S3log::Log.info "... done in #{Time.now - time}s."
42
+ S3log::Log.info "#{@jobname} ... done in #{Time.now - time}s."
42
43
  else
43
44
  S3log::Log.debug "No file to download."
44
45
  end
data/lib/s3log/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module S3log
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: s3log
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
  - mose