jobmanager 1.0.1 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +7 -1
- data/Manifest.txt +6 -2
- data/README.txt +66 -32
- data/Rakefile +2 -2
- data/examples/jobmanager.yaml +19 -9
- data/lib/jobmanager/application.rb +32 -31
- data/lib/jobmanager/applicationconfig.rb +15 -3
- data/lib/jobmanager/applicationoptionparser.rb +19 -5
- data/lib/jobmanager/openonfirstwritefile.rb +65 -0
- data/lib/jobmanager/system.rb +15 -8
- data/lib/jobmanager/teestream.rb +21 -39
- data/lib/jobmanager/timestampedstream.rb +89 -0
- data/test/configs/all_values.yaml +7 -1
- data/test/configs/jobmanager_4_bad_job_logs_directory_1.yaml +1 -1
- data/test/configs/{jobmanager_4_bad_job_logs_directory_2.yaml → jobmanager_5_bad_job_log_file.yaml} +0 -0
- data/test/configs/jobmanager_6.yaml +9 -0
- data/test/configs/jobmanager_7_no_log_rotation.yaml +15 -0
- data/test/test_applicationlogger.rb +3 -0
- data/test/test_config.rb +33 -22
- data/test/test_jobmanager.rb +133 -62
- data/test/test_openonfirstwritefile.rb +71 -0
- data/test/test_system.rb +3 -3
- data/test/test_teestream.rb +45 -2
- metadata +11 -6
- data/examples/mysql_backup.rb +0 -18
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jobmanager
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- DesigningPatterns
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date:
|
12
|
+
date: 2009-06-01 00:00:00 -04:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -50,7 +50,7 @@ dependencies:
|
|
50
50
|
requirements:
|
51
51
|
- - ">="
|
52
52
|
- !ruby/object:Gem::Version
|
53
|
-
version: "
|
53
|
+
version: "1.1"
|
54
54
|
version:
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: SyslogLogger
|
@@ -70,7 +70,7 @@ dependencies:
|
|
70
70
|
requirements:
|
71
71
|
- - ">="
|
72
72
|
- !ruby/object:Gem::Version
|
73
|
-
version: 1.
|
73
|
+
version: 1.8.0
|
74
74
|
version:
|
75
75
|
description: "This package makes managing cron jobs on unix systems a breeze! It is composed of a single program, +jobmanager+, which is intended to be invoked by cron, or a cron-like application. +jobmanager+, in turn, invokes the specified cron job, in addition to providing the following added value: * Logs the output of the cron jobs. * Rotates the cron job logs. * Manages a central log which records all cron events (when each job starts, finishes, the job's success, etc). * Emails the user the results of the cron job on a configurable condition (on failure only, on success only, etc.) via sendmail or smtp. * Times out a cron job that runs past the configurable timeout. * Easily scales to handle multiple users' cron jobs. * Both the default behavior and the per-cron job behavior are highly configurable."
|
76
76
|
email:
|
@@ -94,21 +94,23 @@ files:
|
|
94
94
|
- bin/jobmanager
|
95
95
|
- examples/email_settings.rb
|
96
96
|
- examples/example.rb
|
97
|
-
- examples/mysql_backup.rb
|
98
97
|
- examples/jobmanager.yaml
|
99
98
|
- lib/jobmanager.rb
|
100
99
|
- lib/jobmanager/applicationconfig.rb
|
101
100
|
- lib/jobmanager/applicationlogger.rb
|
102
101
|
- lib/jobmanager/applicationoptionparser.rb
|
103
102
|
- lib/jobmanager/application.rb
|
103
|
+
- lib/jobmanager/openonfirstwritefile.rb
|
104
104
|
- lib/jobmanager/system.rb
|
105
105
|
- lib/jobmanager/teestream.rb
|
106
|
+
- lib/jobmanager/timestampedstream.rb
|
106
107
|
- lib/jobmanager/util.rb
|
107
108
|
- test/helpers.rb
|
108
109
|
- test/mock_syslog.rb
|
109
110
|
- test/test_applicationlogger.rb
|
110
111
|
- test/test_config.rb
|
111
112
|
- test/test_jobmanager.rb
|
113
|
+
- test/test_openonfirstwritefile.rb
|
112
114
|
- test/test_system.rb
|
113
115
|
- test/test_teestream.rb
|
114
116
|
- test/configs/email_settings.rb
|
@@ -124,7 +126,9 @@ files:
|
|
124
126
|
- test/configs/jobmanager_4_bad_central_log_file.yaml
|
125
127
|
- test/configs/jobmanager_4_bad_email_settings_file.yaml
|
126
128
|
- test/configs/jobmanager_4_bad_job_logs_directory_1.yaml
|
127
|
-
- test/configs/
|
129
|
+
- test/configs/jobmanager_5_bad_job_log_file.yaml
|
130
|
+
- test/configs/jobmanager_6.yaml
|
131
|
+
- test/configs/jobmanager_7_no_log_rotation.yaml
|
128
132
|
- test/configs/minimum_plus_email_settings.yaml
|
129
133
|
- test/configs/minimum_required.yaml
|
130
134
|
has_rdoc: true
|
@@ -156,6 +160,7 @@ specification_version: 2
|
|
156
160
|
summary: This package makes managing cron jobs on unix systems a breeze! It is composed of a single program, +jobmanager+, which is intended to be invoked by cron, or a cron-like application
|
157
161
|
test_files:
|
158
162
|
- test/test_jobmanager.rb
|
163
|
+
- test/test_openonfirstwritefile.rb
|
159
164
|
- test/test_config.rb
|
160
165
|
- test/test_applicationlogger.rb
|
161
166
|
- test/test_teestream.rb
|
data/examples/mysql_backup.rb
DELETED
@@ -1,18 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
print "=================================================\n"
|
4
|
-
print "Backing up Database\n"
|
5
|
-
print "=================================================\n"
|
6
|
-
|
7
|
-
database = ARGV[0]
|
8
|
-
|
9
|
-
command = "mysqldump #{database} > /tmp/#{database}.mysql"
|
10
|
-
print command, "\n"
|
11
|
-
|
12
|
-
if (system("#{command}"))
|
13
|
-
print"\nSuccess!\n"
|
14
|
-
else
|
15
|
-
print "\nFailure!\n"
|
16
|
-
exit(1)
|
17
|
-
end
|
18
|
-
|