Giter Club home page Giter Club logo

split_files's Introduction

SplitFiles

Simple program for splitting large text files (eg. logs) into smaller chunks

Regular usage

Usage: ./split_files.rb directory_path max_size(optional) log_dir(optional) result_path(optional)

Options:

  • directory_path - directory with files to be processed
  • max_size - maximum file size of output file - files are processed line by line rather than byte by byte, so actual size of output files may exceed this value
  • log_dir - directory, where application log files are to be stored
  • result_path - path, where result files are to be saved

If max_size is not specified, default value of 10 MB is used.

If log_dir is not specified, program stores log files in directory path stored in LOG_PATH environmental variable. If that variable is not set, log files are being stored in the directory of the script.

If result_path is not specified, the result files are stored in directory specified by directory_path.

Docker usage

With git repository

git clone https://github.com/Forinil/split_files.git
cd split_files
docker build -t split_files .
docker run -it --rm split_files directory_path max_size(optional) log_dir(optional) result_path(optional)

With docker repository

Docker Hub repository

docker pull forinil/split_files
docker tag forinil/split_files split_files
docker run -it --rm split_files directory_path max_size(optional) log_dir(optional) result_path(optional)

Of course there is no need to tag docker repository image with shorter name before using it, it is simply more convenient for repeated use.

If you want to access application log files after running docker image, you must mount a host directory to one inside the container and point the application to it by either specifying log_dir parameter or LOG_PATH variable (especially if you wish to avoid specifying regular expression as well).

For example:

docker run -it --rm -v `$(pwd)`:/logs -e LOG_PATH=/logs split_files directory_path

split_files's People

Contributors

forinil avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.