oysters 0.9.9 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/oysters/initd/logrotate.rb +8 -5
- data/lib/oysters/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: d3b11d634d34e7f2ef2d727093de55503886b47e
|
4
|
+
data.tar.gz: e453a9a5bfe4791d2e77fbd71331a2b97209c818
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 68164ebfe54736dd6d8dabdcd832ad8e036d803c0d7704ac90df4b0bda8f7f51dff2b5ff12af5e1db80c7d15579a00592d0ef5e7812b396290ce78b64d862cf2
|
7
|
+
data.tar.gz: 7be728bc81d16823e435adbd6993227bb4c55661b929f9b2df42a6422d0c5732122f8889f90e7f522c89f552ebf5f11ad1f62c52a57eff3e57090ac3bd63ef56
|
@@ -7,13 +7,16 @@ Oysters.with_configuration do
|
|
7
7
|
namespace :logrotate do
|
8
8
|
desc 'Install logrotate config'
|
9
9
|
task :install, roles: :app do
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
10
|
+
conf_path = "/etc/logrotate.d/#{application}_logs"
|
11
|
+
log_path = Pathname.new(shared_path).join('log', "#{rails_env}.log").to_s
|
12
|
+
tmp_file = "/tmp/#{application}_logs_#{rand}"
|
13
|
+
location = File.expand_path('../../templates/logrotate_config.erb', __FILE__)
|
14
|
+
config = ERB.new(File.read(location))
|
14
15
|
|
15
16
|
put config.result(binding), tmp_file
|
16
|
-
sudo "mv #{tmp_file}
|
17
|
+
sudo "mv #{tmp_file} #{conf_path}"
|
18
|
+
|
19
|
+
sudo "logrotate #{conf_path}"
|
17
20
|
end
|
18
21
|
end
|
19
22
|
|
data/lib/oysters/version.rb
CHANGED