Class: Bard::Provision::LogRotation
- Inherits:
-
Bard::Provision
- Object
- Struct
- Bard::Provision
- Bard::Provision::LogRotation
- Defined in:
- lib/bard/provision/logrotation.rb
Overview
install log rotation if missing
Instance Attribute Summary
Attributes inherited from Bard::Provision
Instance Method Summary collapse
Methods inherited from Bard::Provision
Instance Method Details
#call ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/bard/provision/logrotation.rb', line 4 def call print "Log Rotation:" provision_server.run! " file=/etc/logrotate.d/\#{server.project_name}\n if [ ! -f $file ]; then\n sudo tee $file > /dev/null <<EOF\n $(pwd)/log/*.log {\n weekly\n size 100M\n missingok\n rotate 52\n delaycompress\n notifempty\n copytruncate\n create 664 www www\n }\n EOF\n fi\n SH\n\n puts \" \u2713\"\nend\n", quiet: true |