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! <<~BASH, quiet: true file=/etc/logrotate.d/#{server.project_name} if [ ! -f $file ]; then sudo tee $file > /dev/null <<EOF $(pwd)/log/*.log { weekly size 100M missingok rotate 52 delaycompress notifempty copytruncate create 664 www www } EOF fi BASH puts " ✓" end |