GithubHelp home page GithubHelp logo

dexen / pv-php Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 0.0 28 KB

pv-php - drop-in replacement for pv pipe viewer in PHP

Home Page: https://packagist.org/packages/dexen/pv-php

License: MIT License

Shell 0.28% PHP 99.72%
php pv cli server ssh pipeline shell

pv-php's Introduction

pv - monitor the progress of data through a pipeline

Description

Monitor progress of transfer of large archives, DB backup/restore, etc.

A pure PHP implementation of the pv CLI tool. Useful in case of shared web hostings when you have SSH access, but cannot install packages.

Quoting original pv's manual:

pv shows the progress of data through a pipeline by giving information such as time elapsed, percentage completed (with progress bar), current throughput rate, total data transferred, and ETA.

To use it, insert it in a pipeline between two processes, with the appropriate options. Its standard input will be passed through to its standard output and progress will be shown on standard error.

pv will copy each supplied FILE in turn to standard output (- means standard input), or if no FILEs are specified just standard input is copied. This is the same behaviour as cat(1).

Usage

A subset of options of original pv is supported. The aim is to eventually become fully compatible.

-s SIZE / --size SIZE - assume SIZE bytes to be transferred, for purposes of ETA and completion percentage calculation. Supports 'K' / 'M' / 'G' / 'T' suffix to specify larger units (IEC standard - multiplies of 1024).

-i INTERVAL / --interval INTERVAL - udate display at about INTERVAL seconds. Decimal values are supported. Default: 0.2 seconds.

Environment

Environment variables influencing the script

$TERM - terminal type, influences method of line erase. Supported: xterm / linux - use CR; dumb/any other: use multiple ASCII BS.

$COLUMNS - width of terminal in colums influences output width. Used in case tput cols does not return usable information. Fallback value: 80.

Examples

Restore MySQL backup from a dump file, monitor progress.

pv < mysql-backup-20201122.sql | mysql -u USER -p MY_DATABASE

pv-php's People

Contributors

dexen avatar

Stargazers

 avatar  avatar

Watchers

 avatar  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.