LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > CentOS
User Name
Password
CentOS This forum is for the discussion of CentOS Linux. Note: This forum does not have any official participation.

Notices


Reply
  Search this Thread
Old 09-28-2017, 05:34 AM   #1
robertkwild
Member
 
Registered: Feb 2015
Posts: 382

Rep: Reputation: Disabled
Script to monitor progress of find/exec command


hi all,

i want to monitor the progress of a find and exec command, this is the code i use -


Code:

find . -type f -exec md5sum {} \; >> /md5sums/file.txt


this command works and produces a text file with all the md5sums but while running it doesnt show the progress

is there anyway i can do this

many thanks,

rob
 
Old 09-28-2017, 06:34 AM   #2
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 3,477

Rep: Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553
Quote:
Originally Posted by robertkwild View Post
this command works and produces a text file with all the md5sums but while running it doesnt show the progress
Code:
man tee
 
Old 10-04-2017, 02:49 PM   #3
robertkwild
Member
 
Registered: Feb 2015
Posts: 382

Original Poster
Rep: Reputation: Disabled
the command tee is good if i want to see the output at the same time i copy the output to a file but i want to see like an ETA and progress bar or percent
 
Old 10-04-2017, 04:00 PM   #4
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,746

Rep: Reputation: 5925Reputation: 5925Reputation: 5925Reputation: 5925Reputation: 5925Reputation: 5925Reputation: 5925Reputation: 5925Reputation: 5925Reputation: 5925Reputation: 5925
Not easily... I am not aware of any simple pipe command since find has no clue on total number of files, total bytes or how long it will take to search etc.
 
Old 10-04-2017, 06:21 PM   #5
!!!
Member
 
Registered: Jan 2017
Location: Fremont, CA, USA
Distribution: Trying any&ALL on old/minimal
Posts: 997

Rep: Reputation: 382Reputation: 382Reputation: 382Reputation: 382
Did you want to monitor the/each individual md5sum cmd?
(IF not, just report after each completes here)
IF so, Idk... Maybe some strace trick, to see what block of the file it's reading...

Try like: -exec '( echo {} >/dev/tty; md5sum {} )' \;

Last edited by !!!; 10-04-2017 at 06:29 PM.
 
Old 10-05-2017, 12:49 AM   #6
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,930

Rep: Reputation: 7320Reputation: 7320Reputation: 7320Reputation: 7320Reputation: 7320Reputation: 7320Reputation: 7320Reputation: 7320Reputation: 7320Reputation: 7320Reputation: 7320
duplicate of https://www.linuxquestions.org/quest...734/page2.html
 
Old 10-05-2017, 06:14 AM   #7
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,746

Rep: Reputation: 5925Reputation: 5925Reputation: 5925Reputation: 5925Reputation: 5925Reputation: 5925Reputation: 5925Reputation: 5925Reputation: 5925Reputation: 5925Reputation: 5925
Thread closed per above.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: How to monitor progress of Linux commands using PV and Progress utilities LXer Syndicated Linux News 0 11-11-2016 07:01 PM
Script question with find -exec linuxbird Linux - Newbie 12 05-15-2011 03:21 AM
find command with exec cola Linux - Newbie 5 06-01-2010 01:25 PM
find with -exec: no command output David the H. Linux - Software 5 01-03-2008 01:53 AM
monitor mail box and exec command brumela Linux - General 2 05-30-2005 08:13 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > CentOS

All times are GMT -5. The time now is 06:19 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration