Pre/Post Examples

  1. Windows batch - Call the email notification function when files are transferred to a specified host

    In Windows batch, call the email notification function only on files that are destined for a specific host 10.0.114.111:

    set DESTINATION=10.0.114.111
    if "%TYPE%" == "Session" (
      if "%STARTSTOP%"=="Stop" (
        if "%PEER%" == "%DESTINATION%" (
          "C:\Perl\bin\perl.exe" aspera-notif.pl > nul 2>&1
        )
      )
    )
  2. Windows batch - Call the email notification function when files are larger than 1GB.

    In Windows batch, call the email notification function only when the files are larger than 1GB (1073741824 bytes):

    set FILESIZE=1073741824
    if "%TYPE%" == "Session" (
      if "%STARTSTOP%"=="Stop" (
        if %TOTALSIZE% GEQ %FILESIZE% (
          "C:\Perl\bin\perl.exe" aspera-notif.pl > nul 2>&1
        )
      )
    )
  3. Windows batch - Combine the two examples above.

    In a Windows batch file, call the email notification function on files that are larger than 1GB (1073741824 bytes) and destined for a specific host 10.0.114.111:

    set FILESIZE=1073741824
    set DESTINATION=10.0.114.111
    if "%TYPE%" == "Session" (
      if "%STARTSTOP%"=="Stop" (
        if %TOTALSIZE% GEQ %FILESIZE% (
          if "%PEER%" == "%DESTINATION%" (
            "C:\Perl\bin\perl.exe" aspera-notif.pl > nul 2>&1
          )
        )
      )
    )