New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

rotozipper

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rotozipper

  • 0.1.0
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Rotozipper

Rotozipper is a simple Ruby gem which aims to simplify log rotation and zipping.

Installation

Add this line to your application's Gemfile:

gem 'rotozipper'

And then execute:

$ bundle

Or install it yourself as:

$ gem install rotozipper

Usage

Usage is simple. The gem provides a method launch of the Rotozipper module which takes three arguments:

  • glob_path (required): the path in glob form of the folder where your logs are stored. For example, in a Rails application, you can set it to log/*.log.
  • output_path (optional): the path where you want to save the rotozipped logs. Defaults to a relative history folder.
  • logger_path (optional): the path of a log file where you want to store Rotozipper's operative logs. Defaults to STDOUT.

For example, to rotozip logs of a Rails application, you can execute:

Rotozipper.launch 'log/*.log', 'log/history'

This command will compress all the *.log files in the log folder, and the move them to log/history folder, adding a timestamp to keep track of the moment. The original files will be truncated to 0 bytes.

Scheduling - Rails

Rotozipper has whenever as a gem dependency, so if you need to schedule the rotozipping of your logs, you can simply create a file named config/schedule.rb in your Rails application, and then add the following lines:

# config/schedule.rb

every :week, at: '00:00' do
  runner %{ Rotozipper.launch 'log/*.log', 'log/history' }
end

And then schedule it by running the command whenever --update-crontab. Please refer to whenever documentation to know more about it features.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/Pluve/ruby-rotozipper.

FAQs

Package last updated on 19 Feb 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc