All Projects → Comcast → Infinite-File-Curtailer

Comcast / Infinite-File-Curtailer

Licence: Apache-2.0 license
Curtail is a utility program that reads stdin and writes to a file bound by size.

Programming Languages

c
50402 projects - #5 most used programming language
Makefile
30231 projects
M4
1887 projects

Projects that are alternatives of or similar to Infinite-File-Curtailer

C Utils
Tiny, modular, drop-in, library of some most commonly used utility methods for C (embedded) applications. Intended to be used as a git-submodule inside your projects to kickstart development. See https://c-utils.gotomain.io for more details.
Stars: ✭ 47 (+104.35%)
Mutual labels:  utility, utility-library
Gitlab Cli
Create a merge request from command line in gitlab
Stars: ✭ 224 (+873.91%)
Mutual labels:  utility, command-line-tool
Endlines
Easy conversion between new-line conventions
Stars: ✭ 112 (+386.96%)
Mutual labels:  utility, command-line-tool
Fakeit
The Kotlin fake data generator library!
Stars: ✭ 482 (+1995.65%)
Mutual labels:  utility, utility-library
fastnumbers
Super-fast and clean conversions to numbers.
Stars: ✭ 85 (+269.57%)
Mutual labels:  utility, utility-library
Utils
A collection of useful PHP functions, mini classes and snippets that you need and can use every day.
Stars: ✭ 750 (+3160.87%)
Mutual labels:  utility, utility-library
Georaptor
Python Geohash Compression Tool
Stars: ✭ 143 (+521.74%)
Mutual labels:  utility, command-line-tool
Nomino
Batch rename utility for developers
Stars: ✭ 282 (+1126.09%)
Mutual labels:  utility, command-line-tool
mpu
Martins Python Utilities - Stuff that comes in Handy
Stars: ✭ 47 (+104.35%)
Mutual labels:  utility, utility-library
react-pendulum
A React Context utility library.
Stars: ✭ 15 (-34.78%)
Mutual labels:  utility, utility-library
K2tf
Kubernetes YAML to Terraform HCL converter
Stars: ✭ 477 (+1973.91%)
Mutual labels:  utility, command-line-tool
wifiqr
Create a QR code with your Wi-Fi login details
Stars: ✭ 207 (+800%)
Mutual labels:  utility, command-line-tool
Remarshal
Convert between CBOR, JSON, MessagePack, TOML, and YAML
Stars: ✭ 421 (+1730.43%)
Mutual labels:  utility, command-line-tool
Text Minimap
Generate text minimap/preview using Braille Patterns
Stars: ✭ 21 (-8.7%)
Mutual labels:  utility, command-line-tool
Lodash Php
Easy to use utility functions for everyday PHP projects. This is a port of the Lodash JS library to PHP
Stars: ✭ 412 (+1691.3%)
Mutual labels:  utility, utility-library
Asciigraph
Go package to make lightweight ASCII line graph ╭┈╯ in command line apps with no other dependencies.
Stars: ✭ 1,805 (+7747.83%)
Mutual labels:  utility, command-line-tool
go-tools
A utility tool library of Golang.
Stars: ✭ 44 (+91.3%)
Mutual labels:  utility, utility-library
Graphtage
A semantic diff utility and library for tree-like files such as JSON, JSON5, XML, HTML, YAML, and CSV.
Stars: ✭ 2,062 (+8865.22%)
Mutual labels:  utility, command-line-tool
Bbo
bbo is a utility library of zero dependencies for javascript. 🍖🌭🍔
Stars: ✭ 227 (+886.96%)
Mutual labels:  utility, utility-library
dotfiles
dotfiles symbolic links management CLI
Stars: ✭ 156 (+578.26%)
Mutual labels:  utility, command-line-tool

Infinite-File-Curtailer - a program that reads stdin and writes to a fixed size file.

Requires Linux 3.15+ and a filesystem that supports the FALLOC_FL_COLLAPSE_RANGE flag for fallocate. This is currently ext4 and XFS. Hopefully more in the future...


Usage

./curtail [-s size] <output file>

Options:

-verbose  enable all debug output (on stderr)
-quiet    disable all non-error output (on stderr)
-size     Maximum size of the output file (ie. 8192, 64K, 10M, 1G, etc) - default is 16K

Example

A typical usage scenario is to capture the output of a program in a file. Using curtail prevents the program from creating a runaway file that will eventually fill up the filesystem and cause system failure if not handled at the system level. In the example below, the file my_app_log.txt cannot exceed 2 megabytes in size.

./my_app | curtail -s 2M ./my_app_log.txt

Build instructions

Curtail uses autotools (must be installed on the local system). To build curtail locally, please run the following commands from the base dir of the project:

libtoolize
aclocal
autoheader
autoconf
automake
./configure
make

To install in the local system, run the following additional command with appropriate priviledges:

make install

Library usage

Curtail can also be integrated directly into an application instead of used on the command line. Include the file curtail.h and link the application with -lcurtail. After successfully calling crtl_init, the program's stdout will be directed to the specified file until crtl_term is called.

Logrotate comparision

Curtail is not intended to be a replacement for logrotate. They are fundamentally different. Some of the notable differences are below:

logrotate mitigates runaway files... curtail prevents them.
logrotate requires sysadmin... curtail does not. logrotate creates multiple files... curtail only one.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].