s3log 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 +4 -4
- data/CHANGELOG.md +5 -0
- data/README.md +1 -1
- data/lib/s3log/cron.rb +3 -3
- data/lib/s3log/runner.rb +3 -2
- data/lib/s3log/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0bde1aff2eb20a032be6705f2a5c9d47ad593799
|
4
|
+
data.tar.gz: 17b2ca8475e553f3b606099bcb9b086e5fc2c21f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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