Created
March 24, 2021 09:33
-
-
Save nosmall/16b9e0a6bfb773d15bb38e6f573d22b5 to your computer and use it in GitHub Desktop.
iperf3 Speedtest Cron with Mail - BATCH for windows
This file contains 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
@echo off | |
:LOOP | |
cls | |
set hr=%time:~0,2% | |
if "%hr:~0,1%" equ " " set hr=0%hr:~1,1% | |
REM SET LOGFILE=%date:~-4,4%_%date:~-7,2%_%date:~-10,2%__%hr%_%time:~3,2%_%time:~6,2%.log | |
SET LOGFILE=%date:~-4,4%_%date:~-7,2%_%date:~-10,2%__%hr%_%time:~3,2%.log | |
echo. | |
echo Test Uploadu | |
iperf3.exe --format m --client srv3.server.tld --parallel 1 > %LOGFILE% | |
echo Hotovo | |
echo. | |
echo Test Downloadu | |
iperf3.exe --format m --client srv3.server.tld --parallel 1 --reverse >> %LOGFILE% | |
echo Hotovo | |
echo. | |
echo Posilam LOG Emailem | |
REM if exist log file send it | |
for %%A in (%LOGFILE%) do if not %%~zA==0 ( | |
mailsend-go.exe -sub "RE: SpeedTest LOG" body -file "%LOGFILE%" -to "[email protected]" -smtp smtp.domain.tld -port 465 auth -user [email protected] -pass "SomeSecretPassword777" -bcc "[email protected]" -from "[email protected]" | |
) else ( del %LOGFILE% /f /q ) | |
echo. | |
echo Opakovani testu za | |
timeout /T 18000 /NOBREAK | |
if not ErrorLevel 1 goto :LOOP |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment