LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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, 06:34 AM   #1
robertkwild
Member
 
Registered: Feb 2015
Posts: 376

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, 07:34 AM   #2
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 2,854

Rep: Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148
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, 03:49 PM   #3
robertkwild
Member
 
Registered: Feb 2015
Posts: 376

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, 05:00 PM   #4
michaelk
Moderator
 
Registered: Aug 2002
Posts: 18,058

Rep: Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498
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, 07:21 PM   #5
!!!
Member
 
Registered: Jan 2017
Posts: 666

Rep: Reputation: 289Reputation: 289Reputation: 289
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 07:29 PM.
 
Old 10-05-2017, 01:49 AM   #6
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 12,010

Rep: Reputation: 3687Reputation: 3687Reputation: 3687Reputation: 3687Reputation: 3687Reputation: 3687Reputation: 3687Reputation: 3687Reputation: 3687Reputation: 3687Reputation: 3687
duplicate of https://www.linuxquestions.org/quest...734/page2.html
 
Old 10-05-2017, 07:14 AM   #7
michaelk
Moderator
 
Registered: Aug 2002
Posts: 18,058

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


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 08:01 PM
Script question with find -exec linuxbird Linux - Newbie 12 05-15-2011 04:21 AM
find command with exec cola Linux - Newbie 5 06-01-2010 02:25 PM
find with -exec: no command output David the H. Linux - Software 5 01-03-2008 02:53 AM
monitor mail box and exec command brumela Linux - General 2 05-30-2005 09:13 AM

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

All times are GMT -5. The time now is 04:50 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration