Created
August 6, 2015 06:58
-
-
Save basilevs/42edabece826242a223a to your computer and use it in GitHub Desktop.
Fetches a latest distiributive over SCP and runs it
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
set [email protected] | |
set REM_PATH=/mnt/data/distr | |
set NAME= | |
FOR /F "tokens=* USEBACKQ" %%F IN (`plink %HOST% "ls -rt %REM_PATH%/*.exe | tail -n 1 | cut | |
-d / -f 5"`) DO ( | |
SET NAME=%%F | |
) | |
pscp %HOST%:%REM_PATH%/%NAME% . | |
%NAME% |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment