How to monitor long running scripts with pv


Sometimes you want to run a long running process without feedback. PV is a tool that allows you to do just that.


  • Running a mysqldump
    mysqldump <yourparams> | pv --progress --size 100m > /tmp/dump.sql
  • Importing a mysql dump
    pv dump.sql | mysql <yourparams>
  • Copying a large file
    pv /originallocation/largefile.bin > /otherlocation/largefile.bin
  • Create a zip file
    pv largefile.txt | zip >
  • Create a tar archive
    tar -czf - ./foldertotar | (pv -p --timer --rate --bytes > backup.tgz)


Sounds cool, but pv isn’t available by default.


Luckily, there is an easy solution.

Simply add the pv package in your file. This will automatically install pv. So you can use it.

  nodejs: # Specify one NPM package per line.
    pv: '~1.0.1'

Note: you can do this in any container type. PHP, nodejs, golang, …

This works because there is a nodejs package that does the heavy lifting for us.

For more information on dependencies, check our documentation