rbatch 2.3.0 → 2.3.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.
- data/.travis.yml +1 -1
- data/Gemfile +5 -0
- data/README.ja.md +2 -1
- data/README.md +2 -1
- data/lib/rbatch/log.rb +5 -1
- data/lib/rbatch/version.rb +1 -1
- data/sample/.rbatchrc +38 -18
- metadata +2 -2
data/.travis.yml
CHANGED
data/Gemfile
CHANGED
data/README.ja.md
CHANGED
@@ -426,7 +426,7 @@ Run-Conf(`${RB_HOME}/.rbatchrc`)のサンプルは以下の通り
|
|
426
426
|
#log_mail_server_host : "localhost"
|
427
427
|
#log_mail_server_port : 25
|
428
428
|
#
|
429
|
-
#
|
429
|
+
# 宛先を複数指定した場合は配列を利用する
|
430
430
|
#
|
431
431
|
#log_mail_to :
|
432
432
|
# - "AAA@sample.com"
|
@@ -469,6 +469,7 @@ opt = {
|
|
469
469
|
:stdout => false,
|
470
470
|
:delete_old_log => false,
|
471
471
|
:delete_old_log_date => 7,
|
472
|
+
:bufferd => false,
|
472
473
|
:send_mail => false,
|
473
474
|
:mail_to => nil,
|
474
475
|
:mail_from => "rbatch.localhost",
|
data/README.md
CHANGED
@@ -422,7 +422,7 @@ Sample of RBatch Run-Conf `${RB_HOME}/.rbatchrc`.
|
|
422
422
|
#log_mail_server_host : "localhost"
|
423
423
|
#log_mail_server_port : 25
|
424
424
|
#
|
425
|
-
# if you want to send multiple recipients
|
425
|
+
# if you want to send multiple recipients, use array.
|
426
426
|
#
|
427
427
|
#log_mail_to :
|
428
428
|
# - "AAA@sample.com"
|
@@ -466,6 +466,7 @@ opt = {
|
|
466
466
|
:stdout => false,
|
467
467
|
:delete_old_log => false,
|
468
468
|
:delete_old_log_date => 7,
|
469
|
+
:bufferd => false,
|
469
470
|
:send_mail => false,
|
470
471
|
:mail_to => nil,
|
471
472
|
:mail_from => "rbatch.localhost",
|
data/lib/rbatch/log.rb
CHANGED
@@ -228,7 +228,11 @@ module RBatch
|
|
228
228
|
+ "$")
|
229
229
|
if r =~ file && Date.strptime($1,"%Y%m%d") <= Date.today - date
|
230
230
|
@@journal.put 1, "Delete old log file: " + File.join(@vars[:log_dir] , file)
|
231
|
-
|
231
|
+
begin
|
232
|
+
File::delete(File.join(@vars[:log_dir] , file))
|
233
|
+
rescue Exception => e
|
234
|
+
@@journal.put 1, "Fail to delete old log file. Skipped."
|
235
|
+
end
|
232
236
|
end
|
233
237
|
end
|
234
238
|
end
|
data/lib/rbatch/version.rb
CHANGED
data/sample/.rbatchrc
CHANGED
@@ -26,7 +26,7 @@
|
|
26
26
|
# Default is "<home>/lib"
|
27
27
|
# <home> is replaced to ${RB_HOME}
|
28
28
|
#
|
29
|
-
#lib_dir
|
29
|
+
#lib_dir: /usr/local/lib/rbatch/
|
30
30
|
|
31
31
|
# Auto Library Load
|
32
32
|
#
|
@@ -41,24 +41,31 @@
|
|
41
41
|
# Default is false.
|
42
42
|
# If true, two same name scripts cannot run at the same time.
|
43
43
|
#
|
44
|
-
#forbid_double_run
|
45
|
-
#forbid_double_run
|
44
|
+
#forbid_double_run: true
|
45
|
+
#forbid_double_run: false
|
46
46
|
|
47
|
-
# Journal
|
47
|
+
# RBatch Journal Level
|
48
48
|
#
|
49
49
|
# Default is 1
|
50
|
-
#
|
50
|
+
# RBatch Journal is message of RBatch and is output to STDOUT.
|
51
|
+
# If 2, put much more information.
|
51
52
|
# If 0, put nothing.
|
52
|
-
#
|
53
|
-
#
|
53
|
+
#
|
54
|
+
# Example of RBatch Journal are follows.
|
55
|
+
# [RBatch] === START RBatch === (PID=5795)
|
56
|
+
# [RBatch] RB_HOME : "/path/to/"
|
57
|
+
# [RBatch] Load Run-Conf: "/path/to/.rbatchrc"
|
58
|
+
# [RBatch] Start Script : "/path/to/bin/hello.rb"
|
59
|
+
# ....
|
54
60
|
#
|
55
61
|
#rbatch_journal_level : 2
|
56
62
|
#rbatch_journal_level : 0
|
57
63
|
|
58
|
-
# Mix Journal
|
64
|
+
# Mix RBatch Journal to Logs
|
59
65
|
#
|
60
66
|
# Default is true.
|
61
|
-
# If true,
|
67
|
+
# If true, RBatch Journal is output not only STDOUT
|
68
|
+
# but also log file(s) which is(are) opened at time.
|
62
69
|
#
|
63
70
|
#mix_rbatch_journal_to_logs : true
|
64
71
|
#mix_rbatch_journal_to_logs : false
|
@@ -111,24 +118,31 @@
|
|
111
118
|
# Delete old log files
|
112
119
|
#
|
113
120
|
# Default is false.
|
114
|
-
# If this is true, delete old log
|
115
|
-
#
|
116
|
-
# RBatch::Log instance, and log filename format include "<date>".
|
121
|
+
# If this is true, delete old log files when RBatch::Log.new is called.
|
122
|
+
# If log filename format does not include "<date>", do nothing.
|
117
123
|
#
|
118
|
-
#log_delete_old_log: true
|
119
|
-
#log_delete_old_log: false
|
124
|
+
#log_delete_old_log : true
|
125
|
+
#log_delete_old_log : false
|
120
126
|
|
121
|
-
# Expire
|
127
|
+
# Expire Days of Log Files
|
122
128
|
#
|
123
129
|
# Default is 7.
|
124
130
|
#
|
125
|
-
#log_delete_old_log_date: 14
|
131
|
+
#log_delete_old_log_date : 14
|
132
|
+
|
133
|
+
# Log buffering
|
134
|
+
#
|
135
|
+
# Default is false.
|
136
|
+
# If true, log output is bufferd.
|
137
|
+
#
|
138
|
+
#log_bufferd : true
|
139
|
+
#log_bufferd : false
|
126
140
|
|
127
141
|
# Send Mail
|
128
142
|
#
|
129
143
|
# Default is false.
|
130
|
-
# When log.error
|
131
|
-
#
|
144
|
+
# When log.error is called, log.fatal is called,
|
145
|
+
# or rescue an Exception, send e-mail.
|
132
146
|
#
|
133
147
|
#log_send_mail : true
|
134
148
|
|
@@ -138,6 +152,12 @@
|
|
138
152
|
#log_mail_from : "xxx@sample.com"
|
139
153
|
#log_mail_server_host : "localhost"
|
140
154
|
#log_mail_server_port : 25
|
155
|
+
#
|
156
|
+
# if you want to send multiple recipients, use array.
|
157
|
+
#
|
158
|
+
#log_mail_to :
|
159
|
+
# - "AAA@sample.com"
|
160
|
+
# - "BBB@sample.com"
|
141
161
|
|
142
162
|
# -------------------
|
143
163
|
# Cmd setting
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: rbatch
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 2.3.
|
5
|
+
version: 2.3.1
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- fetaro
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2014-
|
13
|
+
date: 2014-12-08 00:00:00 Z
|
14
14
|
dependencies: []
|
15
15
|
|
16
16
|
description: Batch Script Framework
|