Skip to content

mieweb/iforgotpv

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 

Repository files navigation

iforgotpv

Did you forget to run pv on a long running command? iforgotpv to the rescue!

Play Demo

https://youtu.be/Q0Jn6tYQbCU

Description

iforgotpv is a bash script that allows you to monitor the progress of a running process that's reading from or writing to a file. It's particularly useful when you've started a long-running command and wish you had used `pv` (Pipe Viewer) to monitor its progress.

iforgotpv is similar to progress but is implemented as a bash script instead of C.

Features

  • Displays progress percentage, current position, total size, transfer rate, and estimated time of arrival (ETA)
  • Shows start and end times of the monitored process
  • Works with any process ID and file descriptor
  • Easy to use with minimal setup

Installation

Run from net (if you dare)

curl https://raw.githubusercontent.com/mieweb/iforgotpv/main/iforgotpv > iforgotpv
chmod a+x iforgotpv
./iforgotpv

For Debian-based systems (using apt):

sudo apt update
sudo apt install iforgotpv

For Red Hat-based systems (using yum):

sudo yum update
sudo yum install iforgotpv

Usage

iforgotpv <pid> [fd] [interval]
  • pid: Process ID of the command you want to monitor
  • fd: File descriptor (optional, defaults to 1 for stdout)
  • interval: Update interval in seconds (optional, defaults to 1)

Examples

  1. Monitor a process with PID 1234, updating every second:

    iforgotpv 1234
    
  2. Monitor a process with PID 5678, file descriptor 3, updating every 5 seconds:

    iforgotpv 5678 3 5
    
  3. List file descriptors for a process:

    iforgotpv 1234
    

Output

The script displays a single-line, continuously updating progress bar with the following information:

  • Percentage complete
  • Current position / Total size
  • Transfer rate
  • Estimated time of arrival (ETA)

It also shows the start time when the script begins and the end time when the monitored process completes.

Notes

  • This script requires root privileges or appropriate permissions to access /proc filesystem information for the target process.
  • The script will exit when the monitored process completes or if it encounters an error.

License

MIT License Credit: https://claude.ai/chat/a27ea613-ddf2-4d5e-9a72-3ca896e49f37

TODO

Use FPM to make packages

fpm -s dir -t rpm -n iforgotpv -v 1.0 --prefix=/usr/local iforgotpv/usr/local/bin/iforgotpv fpm -s dir -t deb -n iforgotpv -v 1.0 --prefix=/usr/local iforgotpv/usr/local/bin/iforgotpv

Contributing

Contributions, issues, and feature requests are welcome! Feel free to check issues page.

Show your support

Give a ⭐️ if this project helped you!

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages