Last active
July 5, 2018 12:41
-
-
Save mz0/e5bd34e287862f1963dfb014f93ce4a0 to your computer and use it in GitHub Desktop.
monitor disk-copy progress (Unix/macOS)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Total=2695716 | |
BW=28.5 | |
Last=0 | |
while true; do | |
echo -n $(date +%H:%M:%S.%N); # %N - nanoseconds, GNU 'date' only | |
Curr=$(df -m /dev/sdd1 |grep sdd1|awk '{print $3}'); | |
Remain=$(expr "$Total" - "$Curr") | |
TtRun=$(echo "(($Remain / $BW) +0.5)/1" | bc) | |
ETA=$(date --date="+ $TtRun seconds") # GNU 'date' only | |
echo ' '$Curr' +'$(expr "$Curr" - "$Last") MB "; ETA: $ETA (@ $BW MBps)" | |
Last=$Curr | |
sleep 100; # debug with 'sleep 1', use 10,100 for better BW estimates | |
done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
linux $ . cprogress # rsync over ssh from Macbook to USB3-attached HDD | |
11:31:17.157009569 137309 +137309 MB ; ETA: Sat Apr 28 12:27:25 MSK 2018 (@ 28.5 MBps) | |
11:32:57.193349436 140155 +2846 MB ; ETA: Sat Apr 28 12:27:25 MSK 2018 (@ 28.5 MBps) | |
11:34:37.223771446 143003 +2848 MB ; ETA: Sat Apr 28 12:27:25 MSK 2018 (@ 28.5 MBps) | |
^C | |
mac $ . cprogress # local copy via USB2-port | |
13:36:19 257993 +257993 MB ; ETA: Sun Apr 29 00:19:50 MSK 2018 (@ 19.5 MBps) | |
13:38:00 259976 +1983 MB ; ETA: Sun Apr 29 00:19:49 MSK 2018 (@ 19.5 MBps) | |
13:39:40 261988 +2012 MB ; ETA: Sun Apr 29 00:19:46 MSK 2018 (@ 19.5 MBps) | |
.. | |
17:12:19 513716 +2054 MB ; ETA: Sun Apr 29 00:17:16 MSK 2018 (@ 19.5 MBps) # looks like it makes > 19.5 MBps | |
17:14:00 515669 +1953 MB ; ETA: Sun Apr 29 00:17:17 MSK 2018 (@ 19.5 MBps) # but not much: < 3 minutes delta this far | |
.. | |
Copy speed estimate: 19.65 MBps | |
23:42:58 2661309 +2014 MB ; ETA: Sun Apr 29 00:12:08 MSK 2018 | |
23:44:38 2663322 +2013 MB ; ETA: Sun Apr 29 00:12:06 MSK 2018 | |
23:46:18 2665252 +1930 MB ; ETA: Sun Apr 29 00:12:08 MSK 2018 | |
23:47:58 2667304 +2052 MB ; ETA: Sun Apr 29 00:12:03 MSK 2018 | |
.. | |
00:08:04 2690857 +1954 MB ; ETA: Sun Apr 29 00:12:11 MSK 2018 | |
00:09:44 2692307 +1450 MB ; ETA: Sun Apr 29 00:12:37 MSK 2018 | |
00:11:24 2692307 +0 MB ; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Total=2695716 | |
Last=0 | |
Target='/Volumes/Seagate2T8' | |
BW=19.65 | |
echo "Copy speed estimate: $BW MBps" | |
while true; do | |
echo -n $(date +%H:%M:%S); | |
Curr=$(df -m $Target |grep Seagate2T8|awk '{print $3}'); | |
Remain=$(expr "$Total" - "$Curr") | |
TtRun=$(echo "(($Remain / $BW) +0.5)/1" | bc) | |
ETA=$(date -v+${TtRun}S) | |
echo ' '$Curr' +'$(expr "$Curr" - "$Last") MB "; ETA: $ETA" | |
Last=$Curr | |
sleep 100; | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
track Google Drive sync progress (a fresh macOS downloading 62.2 GB of cloud files over 100Mbps connection)
output: