Got some valuable help here earlier with grep so hopefully I can get this sorted out too.
This is from Rclone log
Transferred: 577.080M / 577.080 MBytes, 100%, 12.660 MBytes/s, ETA 0s Errors: 0 Checks: 2 / 2, 100% Transferred: 2 / 2, 100% Elapsed time: 45.5s
What I am trying to do is create a email notification with custom text. Something like "Transferred 577 MBytes, 2 files with 0 errors in 45.5 seconds @ 12,660 MBytes/s"
So for this to work I need to print the values. I tried the same way I did before without any luck. Transferred it two times in the log, how to split them to get TRF= 577.080Mbytes and TRS= 12.660 MBytes/s
TRF=$(grep -o 'Transferred:.*' $logfile| cut -d\ -f4) ERR=$(grep -o 'Errors:.*' $logfile | cut -d\ -f4) TIM=$(grep -o 'Elapsed time:.*' $logfile | cut -d\ -f3-) TRS=$(grep -o 'Transferred:.*' $logfile | cut -d\ -f4)