LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   CentOS (https://www.linuxquestions.org/questions/centos-111/)
-   -   Script to monitor progress of find/exec command (https://www.linuxquestions.org/questions/centos-111/script-to-monitor-progress-of-find-exec-command-4175614675/)

robertkwild 09-28-2017 05:34 AM

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

TenTenths 09-28-2017 06:34 AM

Quote:

Originally Posted by robertkwild (Post 5763896)
this command works and produces a text file with all the md5sums but while running it doesnt show the progress

Code:

man tee

robertkwild 10-04-2017 02:49 PM

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

michaelk 10-04-2017 04:00 PM

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.

!!! 10-04-2017 06:21 PM

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 {} )' \;

pan64 10-05-2017 12:49 AM

duplicate of https://www.linuxquestions.org/quest...734/page2.html

michaelk 10-05-2017 06:14 AM

Thread closed per above.


All times are GMT -5. The time now is 02:52 AM.