ExtractSizeFromRsyncLog extracts the size from rsync logs
(logFile string)
| 137 | |
| 138 | // ExtractSizeFromRsyncLog extracts the size from rsync logs |
| 139 | func ExtractSizeFromRsyncLog(logFile string) string { |
| 140 | // (?m) flag enables multi-line mode |
| 141 | re := regexp.MustCompile(`(?m)^Total file size: ([0-9\.]+[KMGTP]?) bytes`) |
| 142 | return ExtractSizeFromLog(logFile, re) |
| 143 | } |
| 144 | |
| 145 | // TranslateRsyncErrorCode translates the exit code of rsync to a message |
| 146 | func TranslateRsyncErrorCode(cmdErr error) (exitCode int, msg string) { |