I'm more familiar with GNU ddrescue, but both use a more sensible default block size than dd, keep going in case of errors, show progress and warn you if you try to overwrite a disk or partition.
That said, since I usually stick to dd because it's installed in most of our systems by default, I'd like to share a trick: if you already launched dd and don't want to stop it and launch it again with pv, you can make it tell you how far it is running from a different console 'kill -USR1 $(pidof dd)'.
Authored Comments
Also, you can download a precompiled binary of shellcheck from its github repo if you rather have the latest.
BTW, shellcheck will complain that you should'nt use "for file in $(ls)" but "for file in *" :)
"And in all that time, nothing's come along that does the job better"
I guess it's subjective, but I actually consider GNU ddrescue (https://www.gnu.org/software/ddrescue/) and dd_rescue (http://www.garloff.de/kurt/linux/ddrescue/) to be better tools than plain dd.
I'm more familiar with GNU ddrescue, but both use a more sensible default block size than dd, keep going in case of errors, show progress and warn you if you try to overwrite a disk or partition.
And, if you prefer something more visual, there's Clonezilla (http://clonezilla.sourceforge.net/).
That said, since I usually stick to dd because it's installed in most of our systems by default, I'd like to share a trick: if you already launched dd and don't want to stop it and launch it again with pv, you can make it tell you how far it is running from a different console 'kill -USR1 $(pidof dd)'.
Cheers.