Sha256: 1b7ad12a1530f3ed86656fdf91d44ef44d2182cb606f131452a718ae001050ef

Contents?: true

Size: 544 Bytes

Versions: 11

Compression:

Stored size: 544 Bytes

Contents

# install log rotation if missing

class Bard::Provision::LogRotation < Bard::Provision
  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
end



Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
bard-1.3.9 lib/bard/provision/logrotation.rb
bard-1.3.8 lib/bard/provision/logrotation.rb
bard-1.3.7 lib/bard/provision/logrotation.rb
bard-1.3.6 lib/bard/provision/logrotation.rb
bard-1.3.5 lib/bard/provision/logrotation.rb
bard-1.3.4 lib/bard/provision/logrotation.rb
bard-1.3.3 lib/bard/provision/logrotation.rb
bard-1.3.2 lib/bard/provision/logrotation.rb
bard-1.3.1 lib/bard/provision/logrotation.rb
bard-1.3.0 lib/bard/provision/logrotation.rb
bard-1.2.0 lib/bard/provision/logrotation.rb