rbatch 2.0.0 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +7 -0
- data/README.ja.md +70 -47
- data/README.md +261 -238
- data/bin/rbatch-init +27 -6
- data/doc/RBatch/CommonConfig.html +108 -12
- data/doc/RBatch/Config.html +108 -12
- data/doc/RBatch/Log.html +108 -65
- data/doc/RBatch/RunConf.html +78 -78
- data/doc/RBatch.html +274 -44
- data/doc/created.rid +9 -9
- data/doc/index.html +30 -8
- data/doc/lib/rbatch/cmd_rb.html +1 -1
- data/doc/lib/rbatch/common_config_rb.html +1 -1
- data/doc/lib/rbatch/config_rb.html +1 -1
- data/doc/lib/rbatch/double_run_checker_rb.html +1 -1
- data/doc/lib/rbatch/log_rb.html +1 -1
- data/doc/lib/rbatch/run_conf_rb.html +1 -1
- data/doc/lib/rbatch/version_rb.html +1 -1
- data/doc/lib/rbatch_rb.html +1 -1
- data/lib/rbatch/common_config.rb +36 -10
- data/lib/rbatch/config.rb +36 -10
- data/lib/rbatch/log.rb +12 -1
- data/lib/rbatch/run_conf.rb +4 -1
- data/lib/rbatch/version.rb +1 -1
- data/lib/rbatch.rb +68 -14
- data/sample/.rbatchrc +127 -0
- data/spec/cmd_spec.rb +2 -4
- data/spec/common_config_spec.rb +38 -7
- data/spec/config_spec.rb +36 -6
- data/spec/log_spec.rb +6 -6
- data/spec/rbatch_spec.rb +2 -4
- data/spec/run_conf_spec.rb +3 -2
- data/spec/spec_helper.rb +5 -0
- metadata +5 -3
- data/sample/conf/rbatch.yaml +0 -68
data/README.md
CHANGED
@@ -1,19 +1,21 @@
|
|
1
1
|
[[English]](https://github.com/fetaro/rbatch/blob/master/README.md "english") [[Japanese]](https://github.com/fetaro/rbatch/blob/master/README.ja.md "japanese")
|
2
2
|
|
3
|
-
RBatch:Ruby-base Batch
|
3
|
+
RBatch:Ruby-base Batch Script Framework
|
4
4
|
=============
|
5
5
|
|
6
|
-
About RBatch (
|
6
|
+
About RBatch (for ver 2)
|
7
7
|
--------------
|
8
8
|
|
9
|
-
RBatch is Ruby-base Batch Script Framework. RBatch has many fanctions to help with your making a batch script such as "data backup" or "proccess starting".
|
10
9
|
|
11
|
-
|
10
|
+
RBatch is Ruby-base Batch script framework. RBatch help to make a batch script such as "data backup" or "proccess start ".
|
11
|
+
|
12
|
+
There are following functions.
|
12
13
|
|
13
14
|
* Auto Logging
|
15
|
+
* Auto Library Loading
|
14
16
|
* Auto Mail Sending
|
15
17
|
* Auto Config Reading
|
16
|
-
* External Command Wrapper
|
18
|
+
* External Command Wrapper
|
17
19
|
* Double Run Check
|
18
20
|
|
19
21
|
|
@@ -34,279 +36,301 @@ Manual
|
|
34
36
|
|
35
37
|
### RBatch home directory
|
36
38
|
|
37
|
-
When you set
|
39
|
+
When you set `${RB_HOME}` environment variable, RBatch home directory is fix at `${RB_HOME}`.
|
38
40
|
|
39
|
-
When you do NOT set
|
41
|
+
When you do NOT set `${RB_HOME}`, `${RB_HOME}` is the parent directory of the directory which script is located at. In other words, default of `${RB_HOME}` is `(script path)/../` .
|
40
42
|
|
41
|
-
### Directory Structure and Naming Convention
|
43
|
+
### Directory Structure and File Naming Convention
|
42
44
|
|
43
|
-
RBach has convention of file naming and
|
45
|
+
RBach has convention of file naming and directory structure.
|
44
46
|
|
45
|
-
If you make a script on
|
47
|
+
If you make a script on `${RB_HOME}/bin/hoge.rb`, libraries are `${RB_HOME}/lib/*.rb`, script's config file is `${RB_HOME}/conf/hoge.yaml` , and log file is output at `${RB_HOME}/log/YYYYMMDD_HHMMSS_hoge.log`.
|
46
48
|
|
47
49
|
For example
|
48
|
-
|
49
|
-
${RB_HOME}
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
50
|
+
|
51
|
+
${RB_HOME} <--- RBatch home
|
52
|
+
|
|
53
|
+
|- .rbatchrc <--- RBatch Run-Conf
|
54
|
+
|
|
55
|
+
|- bin <--- Scripts
|
56
|
+
| |- A.rb
|
57
|
+
| |- B.rb
|
58
|
+
|
|
59
|
+
|- conf <--- Config files
|
60
|
+
| |- A.yaml
|
61
|
+
| |- B.yaml
|
62
|
+
|
|
63
|
+
|- log <--- Log files
|
64
|
+
| |- YYYYMMDD_HHMMSS_A.log
|
65
|
+
| |- YYYYMMDD_HHMMSS_B.log
|
66
|
+
|
|
67
|
+
|- lib <--- Libraries
|
68
|
+
|- lib_X.rb
|
69
|
+
|- lib_Y.rb
|
65
70
|
|
66
71
|
### Auto Logging
|
67
72
|
|
68
|
-
Use
|
69
|
-
The default location of log file is
|
70
|
-
If an exception
|
73
|
+
Use auto logging block `RBatch::Log`, RBatch automatically output logfiles.
|
74
|
+
The default location of log file is `${RB_HOME}/log/YYYYMMDD_HHMMSS_(script base).log`.
|
75
|
+
If an exception is raised, then RBatch write the stack trace to the logfile.
|
71
76
|
|
72
77
|
sample
|
73
78
|
|
74
|
-
script :
|
75
|
-
|
76
|
-
require 'rbatch'
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
[2012-10-20 00:59:53 +900] [
|
89
|
-
[2012-10-20 00:59:53 +900] [
|
90
|
-
[
|
91
|
-
[
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
79
|
+
script : `${RB_HOME}/bin/sample1.rb`
|
80
|
+
|
81
|
+
require 'rbatch'
|
82
|
+
RBatch::Log.new(){ |log| # Logging block
|
83
|
+
log.info "info string"
|
84
|
+
log.error "error string"
|
85
|
+
raise "exception"
|
86
|
+
}
|
87
|
+
|
88
|
+
logfile : `${RB_HOME}/log/20121020_005953_sample1.log`
|
89
|
+
|
90
|
+
# Logfile created on 2012-10-20 00:59:53 +0900 by logger.rb/25413
|
91
|
+
[2012-10-20 00:59:53 +900] [INFO ] info string
|
92
|
+
[2012-10-20 00:59:53 +900] [ERROR] error string
|
93
|
+
[2012-10-20 00:59:53 +900] [FATAL] Caught exception; existing 1
|
94
|
+
[2012-10-20 00:59:53 +900] [FATAL] exception (RuntimeError)
|
95
|
+
[backtrace] test.rb:6:in `block in <main>'
|
96
|
+
[backtrace] /usr/local/lib/ruby192/lib/ruby/gems/1.9.1/gems/rbatch-1.0.0/lib/rbatch/auto_logger.rb:37:in `initialize'
|
97
|
+
[backtrace] test.rb:3:in `new'
|
98
|
+
[backtrace] test.rb:3:in `<main>'
|
99
|
+
|
100
|
+
### Auto Library Loading
|
101
|
+
|
102
|
+
If you make libraries at `${RB_HOME}/lib/*.rb`, those files are required before script run.
|
97
103
|
|
98
104
|
### Auto Mail Sending
|
99
105
|
|
100
|
-
By using
|
106
|
+
By using `log_send_mail` option, when an error or fatal log is output in script, RBatch sends error-mail.
|
101
107
|
|
102
108
|
### Auto Config Reading
|
103
109
|
|
104
|
-
|
105
|
-
If you make configuration file which is located ${RB_HOME}/conf/"(program base name).yaml", this file is read automatically.
|
110
|
+
If you make configuration file which is located `${RB_HOME}/conf/"(script base).yaml"`, this file is read automatically.
|
106
111
|
|
107
112
|
sample
|
108
113
|
|
109
|
-
config :
|
110
|
-
|
111
|
-
key: value
|
112
|
-
array:
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
script :
|
119
|
-
|
120
|
-
require 'rbatch'
|
121
|
-
p RBatch::config
|
122
|
-
=> {"key" => "value", "array" => ["item1", "item2", "item3"]}
|
123
|
-
p RBatch::config["key"]
|
124
|
-
=> "value"
|
125
|
-
|
126
|
-
# If key does not exist , raise exception
|
127
|
-
p RBatch::config["not_exist"]
|
128
|
-
=> Raise Exception
|
129
|
-
|
130
|
-
|
131
|
-
If you can use common
|
132
|
-
|
114
|
+
config : `${RB_HOME}/conf/sample2.yaml`
|
115
|
+
|
116
|
+
key: value
|
117
|
+
array:
|
118
|
+
- item1
|
119
|
+
- item2
|
120
|
+
- item3
|
121
|
+
|
122
|
+
|
123
|
+
script : `${RB_HOME}/bin/sample2.rb`
|
124
|
+
|
125
|
+
require 'rbatch'
|
126
|
+
p RBatch::config
|
127
|
+
=> {"key" => "value", "array" => ["item1", "item2", "item3"]}
|
128
|
+
p RBatch::config["key"]
|
129
|
+
=> "value"
|
130
|
+
|
131
|
+
# If key does not exist , raise exception
|
132
|
+
p RBatch::config["not_exist"]
|
133
|
+
=> Raise Exception
|
134
|
+
|
135
|
+
|
136
|
+
If you can use a common config file which is read from all scripts, you make `${RB_HOME}/conf/common.yaml`.
|
137
|
+
You can change name of common config file by using option `common_conf_name`.
|
133
138
|
|
134
139
|
### External Command Wrapper
|
135
140
|
|
136
141
|
RBatch provide a function which wrap external command (such as 'ls').
|
137
142
|
|
138
|
-
This function return a result object which contain command's STDOUT, STDERR ,and exit status.
|
143
|
+
This function return a result object which contain command's "STDOUT", "STDERR" ,and "exit status".
|
139
144
|
|
140
145
|
sample
|
141
|
-
|
142
|
-
require 'rbatch'
|
143
|
-
r = RBatch::cmd("ls")
|
144
|
-
p r.stdout
|
145
|
-
=> "fileA\nfileB\n"
|
146
|
-
p r.stderr
|
147
|
-
=> ""
|
148
|
-
p r.status
|
149
|
-
=> 0
|
150
|
-
|
146
|
+
|
147
|
+
require 'rbatch'
|
148
|
+
r = RBatch::cmd("ls")
|
149
|
+
p r.stdout
|
150
|
+
=> "fileA\nfileB\n"
|
151
|
+
p r.stderr
|
152
|
+
=> ""
|
153
|
+
p r.status
|
154
|
+
=> 0
|
155
|
+
|
156
|
+
If you want to set a timeout of external command, you can use `cmd_timeout` option.
|
151
157
|
|
152
158
|
### Double Run Check
|
153
159
|
|
154
|
-
Using
|
160
|
+
Using `forbid_double_run` option, two same name scripts cannot run at the same time.
|
155
161
|
|
156
162
|
Customize
|
157
163
|
--------------
|
158
164
|
If you want to customize RBatch, you have two methods.
|
159
165
|
|
160
|
-
(1) Write Run-Conf
|
161
|
-
(2) Pass an option object to constructor in your script.
|
166
|
+
* (1) Write Run-Conf `${RB_HOME}/.rbatchrc`.
|
167
|
+
* (2) Pass an option object to constructor in your script.
|
162
168
|
|
163
169
|
When an option is set in both (1) and (2), (2) is prior to (1).
|
164
170
|
|
165
171
|
#### Customize by writing Run-Conf (.rbatchrc)
|
166
172
|
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
#
|
175
|
-
#
|
176
|
-
#
|
177
|
-
|
178
|
-
#
|
179
|
-
#
|
180
|
-
#
|
181
|
-
|
182
|
-
#
|
183
|
-
#
|
184
|
-
#
|
185
|
-
|
186
|
-
#
|
187
|
-
#
|
188
|
-
#
|
189
|
-
#
|
190
|
-
|
191
|
-
|
192
|
-
#
|
193
|
-
#
|
194
|
-
#
|
195
|
-
#
|
196
|
-
|
197
|
-
#
|
198
|
-
|
199
|
-
#
|
200
|
-
#
|
201
|
-
#
|
202
|
-
#
|
203
|
-
#
|
204
|
-
|
205
|
-
#
|
206
|
-
|
207
|
-
#
|
208
|
-
|
209
|
-
#
|
210
|
-
#
|
211
|
-
#
|
212
|
-
#
|
213
|
-
#
|
214
|
-
|
215
|
-
#
|
216
|
-
|
217
|
-
#
|
218
|
-
|
219
|
-
#
|
220
|
-
#
|
221
|
-
#
|
222
|
-
|
223
|
-
#
|
224
|
-
#
|
225
|
-
#
|
226
|
-
|
227
|
-
#
|
228
|
-
#
|
229
|
-
# Default is
|
230
|
-
#
|
231
|
-
#
|
232
|
-
|
233
|
-
#
|
234
|
-
#
|
235
|
-
|
236
|
-
|
237
|
-
#
|
238
|
-
#
|
239
|
-
#
|
240
|
-
# <
|
241
|
-
#
|
242
|
-
#
|
243
|
-
#
|
244
|
-
|
245
|
-
#
|
246
|
-
#
|
247
|
-
|
248
|
-
#
|
249
|
-
#
|
250
|
-
#
|
251
|
-
#
|
252
|
-
#
|
253
|
-
#
|
254
|
-
|
255
|
-
|
256
|
-
#
|
257
|
-
#
|
258
|
-
#
|
259
|
-
#
|
260
|
-
#
|
261
|
-
#
|
262
|
-
|
263
|
-
#
|
264
|
-
#
|
265
|
-
|
266
|
-
#
|
267
|
-
#
|
268
|
-
#
|
269
|
-
#
|
270
|
-
#
|
271
|
-
#
|
272
|
-
|
273
|
-
|
274
|
-
#
|
275
|
-
#
|
276
|
-
#
|
277
|
-
#
|
278
|
-
#
|
279
|
-
#
|
280
|
-
|
281
|
-
#
|
282
|
-
|
283
|
-
#
|
284
|
-
#
|
285
|
-
#
|
286
|
-
#
|
287
|
-
#
|
288
|
-
|
289
|
-
#
|
290
|
-
|
291
|
-
#
|
292
|
-
#
|
293
|
-
#
|
294
|
-
#
|
295
|
-
|
296
|
-
|
297
|
-
#
|
298
|
-
#
|
299
|
-
#
|
300
|
-
#
|
301
|
-
#
|
302
|
-
|
303
|
-
|
173
|
+
Sample of RBatch Run-Conf `${RB_HOME}/.rbatchrc`.
|
174
|
+
|
175
|
+
# RBatch Run-Conf (.rbatchrc)
|
176
|
+
#
|
177
|
+
# This format is YAML.
|
178
|
+
#
|
179
|
+
|
180
|
+
# -------------------
|
181
|
+
# Global setting
|
182
|
+
# -------------------
|
183
|
+
|
184
|
+
# Conf Directory
|
185
|
+
#
|
186
|
+
# Default is "<home>/conf"
|
187
|
+
# <home> is replaced to ${RB_HOME}
|
188
|
+
#
|
189
|
+
#conf_dir: <home>/config/
|
190
|
+
#conf_dir: /etc/rbatch/
|
191
|
+
|
192
|
+
# Common config file name
|
193
|
+
#
|
194
|
+
# Default is "common.yaml"
|
195
|
+
#
|
196
|
+
#common_conf_name: share.yaml
|
197
|
+
|
198
|
+
# Library Directory
|
199
|
+
#
|
200
|
+
# Default is "<home>/lib"
|
201
|
+
# <home> is replaced to ${RB_HOME}
|
202
|
+
#
|
203
|
+
#lib_dir: /usr/local/lib/rbatch/
|
204
|
+
|
205
|
+
# Auto Library Load
|
206
|
+
#
|
207
|
+
# Default is true
|
208
|
+
# If true, require "(library directory)/*.rb" before script run.
|
209
|
+
#
|
210
|
+
#auto_lib_load: true
|
211
|
+
#auto_lib_load: false
|
212
|
+
|
213
|
+
# Forbit Script Double Run
|
214
|
+
#
|
215
|
+
# Default is false.
|
216
|
+
# If true, two same name scripts cannot run at the same time.
|
217
|
+
#
|
218
|
+
#forbid_double_run: true
|
219
|
+
#forbid_double_run: false
|
220
|
+
|
221
|
+
# -------------------
|
222
|
+
# Cmd setting
|
223
|
+
# -------------------
|
224
|
+
|
225
|
+
# Raise Exception
|
226
|
+
#
|
227
|
+
# Default is false.
|
228
|
+
# If true, when command exit status is not 0, raise exception.
|
229
|
+
#
|
230
|
+
#cmd_raise : true
|
231
|
+
#cmd_raise : false
|
232
|
+
|
233
|
+
# Command Timeout
|
234
|
+
#
|
235
|
+
# Default is 0 [sec].
|
236
|
+
#
|
237
|
+
#cmd_timeout: 5
|
238
|
+
|
239
|
+
# -------------------
|
240
|
+
# Log setting
|
241
|
+
# -------------------
|
242
|
+
|
243
|
+
# Log Directory
|
244
|
+
#
|
245
|
+
# Default is "<home>/log"
|
246
|
+
# <home> is replaced to ${RB_HOME}
|
247
|
+
#
|
248
|
+
#log_dir: <home>/rb_log
|
249
|
+
#log_dir: /var/log/rbatch/
|
250
|
+
|
251
|
+
# Log File Name
|
252
|
+
#
|
253
|
+
# Default is "<date>_<time>_<prog>.log".
|
254
|
+
# <data> is replaced to YYYYMMDD date string
|
255
|
+
# <time> is replaced to HHMMSS time string
|
256
|
+
# <prog> is replaced to Program file base name (except extention).
|
257
|
+
# <host> is replaced to Hostname.
|
258
|
+
#
|
259
|
+
#log_name : "<date>_<time>_<prog>.log"
|
260
|
+
#log_name : "<date>_<prog>.log"
|
261
|
+
|
262
|
+
# Append log or not
|
263
|
+
#
|
264
|
+
# Default is ture.
|
265
|
+
#
|
266
|
+
#log_append : true
|
267
|
+
#log_append : false
|
268
|
+
|
269
|
+
# Log Level
|
270
|
+
#
|
271
|
+
# Default is "info".
|
272
|
+
# Effective values are "debug","info","wran","error",and "fatal".
|
273
|
+
#
|
274
|
+
#log_level : "debug"
|
275
|
+
#log_level : "info"
|
276
|
+
#log_level : "warn"
|
277
|
+
#log_level : "error"
|
278
|
+
#log_level : "fatal"
|
279
|
+
|
280
|
+
# Print log string both file and STDOUT
|
281
|
+
#
|
282
|
+
# Default is false.
|
283
|
+
#
|
284
|
+
#log_stdout : true
|
285
|
+
#log_stdout : false
|
286
|
+
|
287
|
+
# Delete old log files
|
288
|
+
#
|
289
|
+
# Default is false.
|
290
|
+
# If this is true, delete old log file when RBatch::Log.new is called.
|
291
|
+
# A log file to delete is a log file which was made by the
|
292
|
+
# RBatch::Log instance, and log filename format include "<date>".
|
293
|
+
#
|
294
|
+
#log_delete_old_log: true
|
295
|
+
#log_delete_old_log: false
|
296
|
+
|
297
|
+
# The day of leaving log files
|
298
|
+
#
|
299
|
+
# Default is 7.
|
300
|
+
#
|
301
|
+
#log_delete_old_log_date: 14
|
302
|
+
|
303
|
+
# Send mail or not
|
304
|
+
#
|
305
|
+
# Default is false.
|
306
|
+
# When log.error(msg) or log.fatal(msg) called , send e-mail
|
307
|
+
# including "msg".
|
308
|
+
#
|
309
|
+
#log_send_mail : true
|
310
|
+
|
311
|
+
# Mail parameters
|
312
|
+
#
|
313
|
+
#log_mail_to : "xxx@sample.com"
|
314
|
+
#log_mail_from : "xxx@sample.com"
|
315
|
+
#log_mail_server_host : "localhost"
|
316
|
+
#log_mail_server_port : 25
|
317
|
+
|
318
|
+
# Mix RBatch Message to Log
|
319
|
+
#
|
320
|
+
# Default is true.
|
321
|
+
# If true, put RBatch message to log file(s) which is opened at time.
|
322
|
+
# Example of RBatch Message
|
323
|
+
# [RBatch] Load Config : "../conf/hoge.yaml"
|
324
|
+
#
|
325
|
+
#mix_rbatch_msg_to_log : true
|
326
|
+
#mix_rbatch_msg_to_log : false
|
327
|
+
|
304
328
|
|
305
329
|
### Customize by passing option object to constructor
|
306
330
|
|
307
|
-
If you want to
|
331
|
+
If you want to change options in a script, you pass an options object to the constructor of RBatch::Log or RBatch::Cmd.
|
308
332
|
|
309
|
-
####
|
333
|
+
#### option of RBatch::Log
|
310
334
|
|
311
335
|
opt = {
|
312
336
|
:name => "<date>_<time>_<prog>.log",
|
@@ -321,21 +345,20 @@ If you want to set options in a script, you hand an argument of options to a con
|
|
321
345
|
:mail_from => "rbatch.localhost",
|
322
346
|
:mail_server_host => "localhost",
|
323
347
|
:mail_server_port => 25
|
324
|
-
|
325
|
-
|
348
|
+
}
|
326
349
|
RBatch::Log.new(opt)
|
327
350
|
|
328
|
-
####
|
351
|
+
#### option of RBatch::Cmd
|
329
352
|
|
330
353
|
opt = {
|
331
354
|
:raise => false,
|
332
355
|
:timeout => 0
|
333
356
|
}
|
334
|
-
|
335
357
|
RBatch::Log.new(cmd_str, opt)
|
336
358
|
|
337
359
|
|
338
360
|
Migration from version 1 to version 2
|
339
361
|
--------------
|
340
362
|
|
341
|
-
Move
|
363
|
+
Move `${RB_HOME}/conf/rbatch.yaml` to `${RB_HOME}/.rbatchrc` .
|
364
|
+
That's all.
|
data/bin/rbatch-init
CHANGED
@@ -1,5 +1,3 @@
|
|
1
|
-
#!/usr/local/bin/ruby
|
2
|
-
|
3
1
|
contents = {}
|
4
2
|
|
5
3
|
contents[".rbatchrc"] = <<EOF
|
@@ -27,10 +25,25 @@ contents[".rbatchrc"] = <<EOF
|
|
27
25
|
#
|
28
26
|
#common_conf_name: share.yaml
|
29
27
|
|
28
|
+
# Library Directory
|
29
|
+
#
|
30
|
+
# Default is "<home>/lib"
|
31
|
+
# <home> is replaced to ${RB_HOME}
|
32
|
+
#
|
33
|
+
#lib_dir: /usr/local/lib/rbatch/
|
34
|
+
|
35
|
+
# Auto Library Load
|
36
|
+
#
|
37
|
+
# Default is true
|
38
|
+
# If true, require "(library directory)/*.rb" before script run.
|
39
|
+
#
|
40
|
+
#auto_lib_load: true
|
41
|
+
#auto_lib_load: false
|
42
|
+
|
30
43
|
# Forbit Script Double Run
|
31
44
|
#
|
32
45
|
# Default is false.
|
33
|
-
# If
|
46
|
+
# If true, two same name scripts cannot run at the same time.
|
34
47
|
#
|
35
48
|
#forbid_double_run: true
|
36
49
|
#forbid_double_run: false
|
@@ -42,7 +55,7 @@ contents[".rbatchrc"] = <<EOF
|
|
42
55
|
# Raise Exception
|
43
56
|
#
|
44
57
|
# Default is false.
|
45
|
-
# If command exit status is not 0, raise exception.
|
58
|
+
# If true, when command exit status is not 0, raise exception.
|
46
59
|
#
|
47
60
|
#cmd_raise : true
|
48
61
|
#cmd_raise : false
|
@@ -60,7 +73,6 @@ contents[".rbatchrc"] = <<EOF
|
|
60
73
|
# Log Directory
|
61
74
|
#
|
62
75
|
# Default is "<home>/log"
|
63
|
-
#
|
64
76
|
# <home> is replaced to ${RB_HOME}
|
65
77
|
#
|
66
78
|
#log_dir: <home>/rb_log
|
@@ -69,7 +81,6 @@ contents[".rbatchrc"] = <<EOF
|
|
69
81
|
# Log File Name
|
70
82
|
#
|
71
83
|
# Default is "<date>_<time>_<prog>.log".
|
72
|
-
# Reservation words are follows.
|
73
84
|
# <data> is replaced to YYYYMMDD date string
|
74
85
|
# <time> is replaced to HHMMSS time string
|
75
86
|
# <prog> is replaced to Program file base name (except extention).
|
@@ -133,6 +144,16 @@ contents[".rbatchrc"] = <<EOF
|
|
133
144
|
#log_mail_server_host : "localhost"
|
134
145
|
#log_mail_server_port : 25
|
135
146
|
|
147
|
+
# Mix RBatch Message to Log
|
148
|
+
#
|
149
|
+
# Default is true.
|
150
|
+
# If true, put RBatch message to log file(s) which is opened at time.
|
151
|
+
# Example of RBatch Message
|
152
|
+
# [RBatch] Load Config : "../conf/hoge.yaml"
|
153
|
+
#
|
154
|
+
#mix_rbatch_msg_to_log : true
|
155
|
+
#mix_rbatch_msg_to_log : false
|
156
|
+
|
136
157
|
EOF
|
137
158
|
|
138
159
|
contents["bin/hello_world.rb"] = <<EOF
|