rbatch 1.8.0 → 1.8.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.
Files changed (48) hide show
  1. data/.gitignore +2 -0
  2. data/CHANGELOG +43 -0
  3. data/HOW_TO_TEST.md +9 -0
  4. data/README.ja.md +6 -5
  5. data/README.md +6 -5
  6. data/Rakefile +1 -38
  7. metadata +78 -112
  8. data/sample/bin/log_backup.rb +0 -20
  9. data/sample/bin/test.rb +0 -6
  10. data/sample/bin/test2.rb +0 -3
  11. data/sample/conf/log_backup.yaml +0 -4
  12. data/sample/log/20130120_apache_log_insert.log +0 -171
  13. data/sample/log/20130120_openam_log_insert.log +0 -143
  14. data/sample/log/20130121_apache_log_insert.log +0 -103
  15. data/sample/log/20130121_file_batch_copy.log +0 -15
  16. data/sample/log/20130121_openam_log_insert.log +0 -39
  17. data/sample/log/20130121_webagent_log_insert.log +0 -432
  18. data/sample/log/20130122_apache_log_insert.log +0 -153
  19. data/sample/log/20130122_openam_log_insert.log +0 -374
  20. data/sample/log/20130122_webagent_log_insert.log +0 -144
  21. data/sample/log/20130129_log_backup.log +0 -95
  22. data/sample/log/20130131_apache_log_insert.log +0 -23
  23. data/sample/log/20130209_test.log +0 -128
  24. data/sample/log/20130210_test.log +0 -68
  25. data/sample/moto/README +0 -16
  26. data/sample/moto/auditlog.src.zip +0 -0
  27. data/sample/moto/build.gradle +0 -106
  28. data/sample/moto/gradle/wrapper/gradle-wrapper.jar +0 -0
  29. data/sample/moto/gradle/wrapper/gradle-wrapper.properties +0 -7
  30. data/sample/moto/gradle.properties +0 -12
  31. data/sample/moto/gradlew +0 -164
  32. data/sample/moto/gradlew.bat +0 -90
  33. data/sample/moto/settings.gradle +0 -1
  34. data/sample/moto/src/main/bin/delete_auditlog.sh +0 -176
  35. data/sample/moto/src/main/bin/delete_workflowinstances.sh +0 -315
  36. data/sample/moto/src/main/bin/import_auth_log.sh +0 -23
  37. data/sample/moto/src/main/etc/delete_auditlog.param +0 -39
  38. data/sample/moto/src/main/etc/delete_workflowinstances.param +0 -30
  39. data/sample/moto/src/main/etc/log4j.xml +0 -28
  40. data/sample/moto/src/main/etc/status.properties +0 -27
  41. data/sample/moto/src/main/etc/sysparam.properties +0 -54
  42. data/sample/moto/src/main/java/jp/ossc/imortAuditlog/DateUtil.java +0 -48
  43. data/sample/moto/src/main/java/jp/ossc/imortAuditlog/ImportAuthLogMain.java +0 -36
  44. data/sample/moto/src/main/java/jp/ossc/imortAuditlog/LogReader.java +0 -521
  45. data/sample/moto/src/main/java/jp/ossc/imortAuditlog/MysqlController.java +0 -315
  46. data/sample/moto/src/main/logrotate/delete_auditlog +0 -6
  47. data/sample/moto/src/main/logrotate/delete_workflowinstanceslog +0 -6
  48. data/sample/moto/src/main/sql/tables.sql +0 -36
data/.gitignore ADDED
@@ -0,0 +1,2 @@
1
+ pkg/
2
+ sample/log/
data/CHANGELOG ADDED
@@ -0,0 +1,43 @@
1
+ -----
2
+ initial
3
+
4
+ 1.1.0(2012/11/9)
5
+ -----
6
+ * make common config file
7
+ * change log option
8
+
9
+ 1.2.0(2012/11/13)
10
+ -----
11
+ * change log level option format
12
+ * make log append option
13
+
14
+ 1.3.0(2012/12/30)
15
+ -----
16
+ * add RBatch::Log to instance interface
17
+ * add double run check option
18
+
19
+ 1.4.0(2013/1/5)
20
+ ----
21
+ * add log_stdout option
22
+ * add sample code
23
+ * add cmd_raise option
24
+ * add log_delete_old_log option
25
+
26
+ 1.5.0(2013/1/11)
27
+ ----
28
+ * change default config dir "../config" -> "../conf"
29
+
30
+ 1.6.0(2013/1/14)
31
+ ----
32
+ * add config key check
33
+
34
+ 1.7.0(2013/01/30)
35
+ ----
36
+ * change log format
37
+ * delete change log format option
38
+
39
+ 1.8.0(2013/02/10)
40
+ ----
41
+ * add log_send_mail option
42
+ * add cmd_timeout option
43
+
data/HOW_TO_TEST.md ADDED
@@ -0,0 +1,9 @@
1
+
2
+ How to Test
3
+ --------------
4
+ ```
5
+ cd (RBatch source code dir)
6
+ ruby -I lib test/cases/test_config.rb
7
+ ruby -I lib test/cases/test_cmd.rb
8
+ ruby -I lib test/cases/test_log.rb
9
+ ```
data/README.ja.md CHANGED
@@ -22,6 +22,7 @@ RBatchについて
22
22
  Logging blockを使うことで、自動的にログファイルに出力することができます。
23
23
  ログファイルはデフォルトで"../log/YYYYMMDD_HHMMSS_${PROG_NAME}.log"に出力されます。
24
24
  例外が発生した場合でも、ログにスタックトレースを出力することができます。
25
+ また、エラーが発生した場合に自動でメールを送信することもできます。
25
26
 
26
27
  サンプル
27
28
 
@@ -281,13 +282,13 @@ $ cat log/YYYYMMDD_HHMMSS_backup.log
281
282
  # デフォルト値は false。
282
283
  # log.error(msg)かlog.fatal(msg) を呼び出したときに,"msg"の内容をメールで送信する。
283
284
  #
284
- #send_mail : true
285
+ #log_send_mail : true
285
286
 
286
287
  # メール送信のパラメータ
287
288
  #
288
- #mail_to : "xxx@sample.com"
289
- #mail_from : "xxx@sample.com"
290
- #mail_server_host : "localhost"
291
- #mail_server_port : 25
289
+ #log_mail_to : "xxx@sample.com"
290
+ #log_mail_from : "xxx@sample.com"
291
+ #log_mail_server_host : "localhost"
292
+ #log_mail_server_port : 25
292
293
 
293
294
  ```
data/README.md CHANGED
@@ -21,6 +21,7 @@ This work on only Ruby 1.9.x or more later.
21
21
  Use Auto Logging block, RBatch automatically write to logfile.
22
22
  Log file default location is "(script file path)/../log/YYYYMMDD_HHMMSS_${PROG_NAME}.log" .
23
23
  If exception occuerd, then RBatch write stack trace to logfile.
24
+ When an error occurs, there is also a function to send an error by e-mail automatically.
24
25
 
25
26
  sample
26
27
 
@@ -276,14 +277,14 @@ Config Sample
276
277
  # Default is false.
277
278
  # When log.error(msg) or log.fatal(msg) called , send e-mail including "msg".
278
279
  #
279
- #send_mail : true
280
+ #log_send_mail : true
280
281
 
281
282
  # Send mail parameters
282
283
  #
283
- #mail_to : "xxx@sample.com"
284
- #mail_from : "xxx@sample.com"
285
- #mail_server_host : "localhost"
286
- #mail_server_port : 25
284
+ #log_mail_to : "xxx@sample.com"
285
+ #log_mail_from : "xxx@sample.com"
286
+ #log_mail_server_host : "localhost"
287
+ #log_mail_server_port : 25
287
288
 
288
289
  ```
289
290
 
data/Rakefile CHANGED
@@ -1,38 +1 @@
1
- require 'rubygems'
2
- require 'rake'
3
- require 'rake/clean'
4
- require 'rake/gempackagetask'
5
- require 'rake/rdoctask'
6
- require 'rake/testtask'
7
-
8
- spec = Gem::Specification.new do |s|
9
- s.name = 'rbatch'
10
- s.version = '1.8.0'
11
- s.extra_rdoc_files = ['README.md', 'LICENSE']
12
- s.summary = 'simple batch framework'
13
- s.description = ''
14
- s.author = 'fetaro'
15
- s.email = 'fetaro@gmail.com'
16
- s.homepage = 'https://github.com/fetaro/rbatch'
17
- s.files = %w(LICENSE README.md README.ja.md Rakefile) + Dir.glob("{lib,test,sample,doc}/**/*")
18
- s.require_path = "lib"
19
-
20
- end
21
-
22
- Rake::GemPackageTask.new(spec) do |p|
23
- p.gem_spec = spec
24
- p.package_files.include("lib/**/*")
25
- p.need_tar = false
26
- p.need_zip = false
27
- end
28
-
29
- Rake::RDocTask.new do |rdoc|
30
- files =['README.md', 'LICENSE', 'CHANGELOG', 'lib/**/*.rb']
31
- rdoc.rdoc_files.add(files)
32
- # rdoc.main = "README.md" # page to start on
33
- rdoc.title = "RBatch Docs"
34
- rdoc.rdoc_dir = 'doc/rdoc' # rdoc output folder
35
- rdoc.options << '--line-numbers'
36
- end
37
-
38
-
1
+ require "bundler/gem_tasks"
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: rbatch
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 1.8.0
5
+ version: 1.8.1
6
6
  platform: ruby
7
7
  authors:
8
8
  - fetaro
@@ -10,136 +10,98 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2013-02-09 00:00:00 Z
13
+ date: 2013-02-11 00:00:00 Z
14
14
  dependencies: []
15
15
 
16
16
  description: ""
17
- email: fetaro@gmail.com
17
+ email:
18
+ - fetaro@gmail.com
18
19
  executables: []
19
20
 
20
21
  extensions: []
21
22
 
22
- extra_rdoc_files:
23
- - README.md
24
- - LICENSE
23
+ extra_rdoc_files: []
24
+
25
25
  files:
26
+ - .gitignore
27
+ - CHANGELOG
28
+ - HOW_TO_TEST.md
26
29
  - LICENSE
27
- - README.md
28
30
  - README.ja.md
31
+ - README.md
29
32
  - Rakefile
30
- - lib/rbatch/config.rb
31
- - lib/rbatch/cmd.rb
32
- - lib/rbatch/log.rb
33
- - lib/rbatch.rb
34
- - test/cases/test_config.rb
35
- - test/cases/test_cmd.rb
36
- - test/cases/test_log.rb
37
- - test/mocks/PrintArgs.exe
38
- - test/mocks/win_cmd.exe
39
- - sample/data/access_log.2012-07-10
40
- - sample/data/amAuthentication.error.1
41
- - sample/data/amAuthentication.access.2012-07-10
42
- - sample/data/amAgent_localhost_80.log.2012-07-10
43
- - sample/data/access_log.1
44
- - sample/data/amAuthentication.error.2012-07-10
45
- - sample/data/amAgent_localhost_80.log.1
46
- - sample/data/amAuthentication.access.1
47
- - sample/log/20130131_apache_log_insert.log
48
- - sample/log/20130120_openam_log_insert.log
49
- - sample/log/20130210_test.log
50
- - sample/log/20130122_apache_log_insert.log
51
- - sample/log/20130122_openam_log_insert.log
52
- - sample/log/20130121_webagent_log_insert.log
53
- - sample/log/20130129_log_backup.log
54
- - sample/log/20130121_file_batch_copy.log
55
- - sample/log/20130209_test.log
56
- - sample/log/20130120_apache_log_insert.log
57
- - sample/log/empty
58
- - sample/log/20130122_webagent_log_insert.log
59
- - sample/log/20130121_openam_log_insert.log
60
- - sample/log/20130121_apache_log_insert.log
61
- - sample/conf/openldap_backup.yaml
62
- - sample/conf/webagent_log_insert.yaml
63
- - sample/conf/apache_log_insert.yaml
64
- - sample/conf/log_backup.yaml
65
- - sample/conf/mysql_data_backup.yaml
66
- - sample/conf/file_batch_copy.yaml
67
- - sample/conf/rbatch.yaml
68
- - sample/conf/openam_log_insert.yaml
69
- - sample/bin/test2.rb
70
- - sample/bin/apache_log_insert.rb
71
- - sample/bin/openldap_backup.rb
72
- - sample/bin/webagent_log_insert.rb
73
- - sample/bin/test.rb
74
- - sample/bin/mysql_data_backup.rb
75
- - sample/bin/openam_log_insert.rb
76
- - sample/bin/file_batch_copy.rb
77
- - sample/bin/log_backup.rb
78
- - sample/moto/README
79
- - sample/moto/gradlew
80
- - sample/moto/gradle.properties
81
- - sample/moto/auditlog.src.zip
82
- - sample/moto/src/main/java/jp/ossc/imortAuditlog/LogReader.java
83
- - sample/moto/src/main/java/jp/ossc/imortAuditlog/ImportAuthLogMain.java
84
- - sample/moto/src/main/java/jp/ossc/imortAuditlog/DateUtil.java
85
- - sample/moto/src/main/java/jp/ossc/imortAuditlog/MysqlController.java
86
- - sample/moto/src/main/logrotate/delete_workflowinstanceslog
87
- - sample/moto/src/main/logrotate/delete_auditlog
88
- - sample/moto/src/main/bin/delete_auditlog.sh
89
- - sample/moto/src/main/bin/delete_workflowinstances.sh
90
- - sample/moto/src/main/bin/import_auth_log.sh
91
- - sample/moto/src/main/etc/status.properties
92
- - sample/moto/src/main/etc/delete_auditlog.param
93
- - sample/moto/src/main/etc/log4j.xml
94
- - sample/moto/src/main/etc/sysparam.properties
95
- - sample/moto/src/main/etc/delete_workflowinstances.param
96
- - sample/moto/src/main/sql/tables.sql
97
- - sample/moto/gradlew.bat
98
- - sample/moto/build.gradle
99
- - sample/moto/gradle/wrapper/gradle-wrapper.properties
100
- - sample/moto/gradle/wrapper/gradle-wrapper.jar
101
- - sample/moto/settings.gradle
33
+ - doc/rdoc/CHANGELOG.html
34
+ - doc/rdoc/LICENSE.html
35
+ - doc/rdoc/RBatch.html
36
+ - doc/rdoc/RBatch/Cmd.html
37
+ - doc/rdoc/RBatch/CmdException.html
38
+ - doc/rdoc/RBatch/CmdResult.html
39
+ - doc/rdoc/RBatch/Config.html
40
+ - doc/rdoc/RBatch/Config/Exception.html
41
+ - doc/rdoc/RBatch/Log.html
42
+ - doc/rdoc/RBatchException.html
43
+ - doc/rdoc/created.rid
44
+ - doc/rdoc/images/brick.png
45
+ - doc/rdoc/images/brick_link.png
46
+ - doc/rdoc/images/bug.png
47
+ - doc/rdoc/images/bullet_black.png
48
+ - doc/rdoc/images/bullet_toggle_minus.png
102
49
  - doc/rdoc/images/bullet_toggle_plus.png
103
- - doc/rdoc/images/page_white_width.png
104
- - doc/rdoc/images/plugin.png
105
50
  - doc/rdoc/images/date.png
51
+ - doc/rdoc/images/find.png
52
+ - doc/rdoc/images/loadingAnimation.gif
106
53
  - doc/rdoc/images/macFFBgHack.png
107
- - doc/rdoc/images/bug.png
108
- - doc/rdoc/images/bullet_toggle_minus.png
109
- - doc/rdoc/images/zoom.png
110
54
  - doc/rdoc/images/package.png
111
- - doc/rdoc/images/page_white_text.png
112
55
  - doc/rdoc/images/page_green.png
113
- - doc/rdoc/images/brick_link.png
114
- - doc/rdoc/images/loadingAnimation.gif
115
- - doc/rdoc/images/find.png
116
- - doc/rdoc/images/wrench_orange.png
117
- - doc/rdoc/images/bullet_black.png
118
- - doc/rdoc/images/wrench.png
119
- - doc/rdoc/images/brick.png
56
+ - doc/rdoc/images/page_white_text.png
57
+ - doc/rdoc/images/page_white_width.png
58
+ - doc/rdoc/images/plugin.png
120
59
  - doc/rdoc/images/ruby.png
121
60
  - doc/rdoc/images/tag_green.png
122
- - doc/rdoc/lib/rbatch/config_rb.html
123
- - doc/rdoc/lib/rbatch/log_rb.html
124
- - doc/rdoc/lib/rbatch/cmd_rb.html
125
- - doc/rdoc/lib/rbatch_rb.html
61
+ - doc/rdoc/images/wrench.png
62
+ - doc/rdoc/images/wrench_orange.png
63
+ - doc/rdoc/images/zoom.png
126
64
  - doc/rdoc/index.html
127
- - doc/rdoc/rdoc.css
128
- - doc/rdoc/created.rid
129
- - doc/rdoc/RBatch.html
130
- - doc/rdoc/RBatch/Config.html
131
- - doc/rdoc/RBatch/Cmd.html
132
- - doc/rdoc/RBatch/CmdResult.html
133
- - doc/rdoc/RBatch/Log.html
134
- - doc/rdoc/RBatch/CmdException.html
135
- - doc/rdoc/RBatch/Config/Exception.html
136
- - doc/rdoc/js/jquery.js
137
65
  - doc/rdoc/js/darkfish.js
66
+ - doc/rdoc/js/jquery.js
138
67
  - doc/rdoc/js/quicksearch.js
139
68
  - doc/rdoc/js/thickbox-compressed.js
140
- - doc/rdoc/LICENSE.html
141
- - doc/rdoc/CHANGELOG.html
142
- - doc/rdoc/RBatchException.html
69
+ - doc/rdoc/lib/rbatch/cmd_rb.html
70
+ - doc/rdoc/lib/rbatch/config_rb.html
71
+ - doc/rdoc/lib/rbatch/log_rb.html
72
+ - doc/rdoc/lib/rbatch_rb.html
73
+ - doc/rdoc/rdoc.css
74
+ - lib/rbatch.rb
75
+ - lib/rbatch/cmd.rb
76
+ - lib/rbatch/config.rb
77
+ - lib/rbatch/log.rb
78
+ - sample/bin/apache_log_insert.rb
79
+ - sample/bin/file_batch_copy.rb
80
+ - sample/bin/mysql_data_backup.rb
81
+ - sample/bin/openam_log_insert.rb
82
+ - sample/bin/openldap_backup.rb
83
+ - sample/bin/webagent_log_insert.rb
84
+ - sample/conf/apache_log_insert.yaml
85
+ - sample/conf/file_batch_copy.yaml
86
+ - sample/conf/mysql_data_backup.yaml
87
+ - sample/conf/openam_log_insert.yaml
88
+ - sample/conf/openldap_backup.yaml
89
+ - sample/conf/rbatch.yaml
90
+ - sample/conf/webagent_log_insert.yaml
91
+ - sample/data/access_log.1
92
+ - sample/data/access_log.2012-07-10
93
+ - sample/data/amAgent_localhost_80.log.1
94
+ - sample/data/amAgent_localhost_80.log.2012-07-10
95
+ - sample/data/amAuthentication.access.1
96
+ - sample/data/amAuthentication.access.2012-07-10
97
+ - sample/data/amAuthentication.error.1
98
+ - sample/data/amAuthentication.error.2012-07-10
99
+ - sample/log/empty
100
+ - test/cases/test_cmd.rb
101
+ - test/cases/test_config.rb
102
+ - test/cases/test_log.rb
103
+ - test/mocks/PrintArgs.exe
104
+ - test/mocks/win_cmd.exe
143
105
  homepage: https://github.com/fetaro/rbatch
144
106
  licenses: []
145
107
 
@@ -166,6 +128,10 @@ rubyforge_project:
166
128
  rubygems_version: 1.7.1
167
129
  signing_key:
168
130
  specification_version: 3
169
- summary: simple batch framework
170
- test_files: []
171
-
131
+ summary: Ruby-based simple batch framework
132
+ test_files:
133
+ - test/cases/test_cmd.rb
134
+ - test/cases/test_config.rb
135
+ - test/cases/test_log.rb
136
+ - test/mocks/PrintArgs.exe
137
+ - test/mocks/win_cmd.exe
@@ -1,20 +0,0 @@
1
- # -*- coding: utf-8 -*-
2
- require 'rbatch'
3
- require 'fileutils'
4
- require 'date'
5
-
6
- RBatch::Log.new do |log|
7
- log.info("Start---------------")
8
- target_dir = RBatch::config["target_dir"]
9
- RBatch::config["file_list"].each do |file_wildcard|
10
- Dir::glob(file_wildcard).each do |file|
11
- if ! File.exists?(File.join(target_dir,File.basename(file)))
12
- log.info("Copy " + file + " to " + target_dir)
13
- FileUtils.cp(file,target_dir)
14
- else
15
- log.info("Skip " + file + " (already backuped)")
16
- end
17
- end
18
- end
19
- end
20
-
data/sample/bin/test.rb DELETED
@@ -1,6 +0,0 @@
1
- # -*- coding: utf-8 -*-
2
- require 'rbatch'
3
-
4
- RBatch::Log.new() do |log|
5
- sdfa
6
- end
data/sample/bin/test2.rb DELETED
@@ -1,3 +0,0 @@
1
- require 'rbatch'
2
-
3
- sleep 100
@@ -1,4 +0,0 @@
1
- file_list:
2
- - /var/log/hoge*
3
- - /var/log/messages
4
- target_dir: /tmp